select sum(val1), ...,
convert(char(9),cdate,112) + convert(char(3),cdate,8) + case when datepart(mi,cdate) < 30 then '00' else '30' end
group by convert(char(9),cdate,112) + convert(char(3),cdate,8) + case when datepart(mi,cdate) < 30 then '00' else '30' end
or you might find it better to create a tally table with the intervals in it and join to that - it will give you the zeroes for no entries.
======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.