I had a problem figuring out what, in my opinion, would be a simple request. I have a table with two fields (EntryDateTime, Message), which, as you might guess, write specific messages with a date stamp for a monitoring application.
I am looking to get the number of all type messages per day, but the temporary part of the stamp (although this is necessary for everything else), giving me problems here.
I was looking for something like:
SELECT COUNT(Message)
FROM DBName.dbo.TableName
WHERE Message = 'LoginFailed'
GROUP BY EntryDateTime
What I am looking for as a result is similar to
2009-06-26, 142
2009-06-27, 259
2009-06-28, 57
Of course, this gives me more messages than
2009-06-26 00:01:01, 11
2009-06026 00:01:02, 12
. , , 365 BETWEEN.