I am using microsoft sql server. I am trying to sort my results by the full time.
My raw data looks like this:
TimeStamp TotalOffered
2012-04-16 08:00:00 18
2012-04-16 08:30:00 34
2012-04-16 09:00:00 30
2012-04-16 09:30:00 68
I am sorting by hour blocks for example sum of data during 08:00:00 is 52, sum of data for 09:00:00 is 98, I have it broken down by day.
The Code i have is:
select datepart(hour,[TimeStamp]), SUM([TotalOffered])
from [my table]
group by
datepart(hour,[sus_CallPerformance_TimeStamp]),
dateadd(d, 0, datediff(d, 0, [sus_CallPerformance_TimeStamp]))
I am trying to get the data to show the full TimeStamp instead of just the hour.
Currently the results show as:
8 52
9 98
I would like the results to show as:
2012-04-16 08:00:00 52
2012-04-16 09:00:00 98
Thank You
1 Answer