Check this:
CREATE TABLE TestData
(
[NAME] VARCHAR(10),
DUE_IN INT,
[VALUE] INT
)
INSERT INTO TestData ([NAME], DUE_IN, [VALUE])
VALUES('A', 15, 15000),
('B', 30, 23000),
('A', 45, 15200),
('A', 78, 45000),
('C', 45, 13000),
('D', 10, 45700),
('D', 45, 45800),
('A', 78, 10220),
('B', 10, 78900),
('A', 46, 98700),
('A', 35, 45000)
DECLARE @tmp TABLE(RangeId INT IDENTITY(1,1), RangeName VARCHAR(10), RangeMin INT, RangeMax INT)
INSERT INTO @tmp (RangeName, RangeMin, RangeMax)
VALUES('>15', 0, 14),('15-30', 15, 30), ('>30', 31, 999999)
SELECT t1.[Name], t2.RangeName AS DUE_IN, SUM(t1.[Value]) AS [SumOfValue]
FROM TestData As t1
INNER JOIN @tmp AS t2 ON t1.[DUE_IN]>=t2.RangeMin AND t1.[DUE_IN]<=t2.RangeMax
GROUP BY t1.[Name], t2.RangeName, t2.RangeId
ORDER BY t1.[Name], t2.RangeId
Result:
Name DUE_IN SumOfValue
A 15-30 15000
A >30 214120
B >15 78900
B 15-30 23000
C >30 13000
D >15 45700
D >30 45800
SQL Fiddle[
^]