An alternative
select cast(1 + (30 * ((TotDays - 1)/ 30)) as varchar) + ' to ' + cast(30 + (30 * ((TotDays - 1)/ 30)) as varchar) as TotDays
, SUM(TotCnt) as TotCnt, SUM(TotValue) as TotValue
from pn46
GROUP BY ((TotDays - 1)/ 30)
Which I tested with the following
Create table pn46
(
TotDays int identity(1,1),
TotCnt int,
TotValue float
)
go
insert into pn46 values(1,10.0)
go 100
And it correctly returned
1 to 30 30 300
31 to 60 30 300
61 to 90 30 300
91 to 120 10 100
etc