Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Makaio780
Starting Member
24 Posts |
Posted - 2012-02-07 : 17:56:37
|
Hi,Im trying to get the sum of tktcount grouped by month. Below is my query.Select count(incident_number)as tktcount,month(Reported_date) as mthfrom vars75_hpd_help_deskwhere reported_Source = 'phone' and (Reported_date > dateadd(mm,datediff(mm,0,getdate())-12,0)) and ( Reported_date < dateadd(month, datediff(month, 0, getdate()), 0))group by reported_dateRon Cheung |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-02-07 : 19:05:15
|
Change the group by clause to:GROUP BY MONTH(Reported_date) |
 |
|
Makaio780
Starting Member
24 Posts |
Posted - 2012-02-08 : 17:01:59
|
Thanks a bunch. It worked flawlessly.Ron Cheung |
 |
|
|
|
|