Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

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.
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

thanks