Select cast(DATEPART(HH, Time) as varchar(10))+ ':00', COUNT(1), SUM(Amount) from DemoTable group by DATEPART(HH, Time)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)