Tags

see http://www.sqlhacks.com/Dates/GroupByMonth

An example…after the jump…

select year(created) as 'Year', month(created) as 'Month',
count(Event_Id) as 'Records' from tblEvents
group by year(created), month(created)
order by year asc, month asc