August 5, 2009 at 9:28 pm
We have database called store, I have an issue to generate the hourly count report dynamically.
Whenever I execute the below query and I get the output as below
Date_TimeMsgCount
2009-08-06 022452
2009-08-06 022210
2009-08-06 034173
2009-08-06 046450
2009-08-06 055452
2009-08-06 062452
2009-08-06 072462
2009-08-06 104521
But I need the output should be
Date_TimeMsgCount
2009-08-06 022452
2009-08-06 022210
2009-08-06 034173
2009-08-06 046450
2009-08-06 055452
2009-08-06 062452
2009-08-06 072462
2009-08-06 080
2009-08-06 090
2009-08-06 104521
I am using the query to generate the report as below,
select convert(varchar(13), lastupdated, 120) As Date_Time, count(*) As MsgCount from store_details(nolock)
group by convert(varchar(13), lastupdated, 120)
order by convert(varchar(13), lastupdated, 120)
Please help me how will I get the output.
Thanks in Advance
August 5, 2009 at 11:26 pm
Duplicate post... no responses here please. Goto http://www.sqlservercentral.com/Forums/Topic765935-8-1.aspx
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply