curiouswebster
asked on
Need more granular date groupings
I have the current query...
SELECT COUNT(*) as Count, DATEPART(day, DateOfException) as Day FROM SFErrorLog WHERE
DateOfException > '2017-04-04 00:00:00.000' GROUP BY DATEPART(day, DateOfException)
ORDER BY DATEPART(day, DateOfException) DESC
but I do not like that way the output does not differentiate between the 5th day of different months. So, I need to get the group by to be combined month and day. You may as well include years, month, day.
Output could look like:
2017-05-09
2017-05-08
2017-05-08
for example...
Thanks.
SELECT COUNT(*) as Count, DATEPART(day, DateOfException) as Day FROM SFErrorLog WHERE
DateOfException > '2017-04-04 00:00:00.000' GROUP BY DATEPART(day, DateOfException)
ORDER BY DATEPART(day, DateOfException) DESC
but I do not like that way the output does not differentiate between the 5th day of different months. So, I need to get the group by to be combined month and day. You may as well include years, month, day.
Output could look like:
2017-05-09
2017-05-08
2017-05-08
for example...
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER