Bones of SQL – Grouping By User-Defined Calendar Periods
Although it is common to group by periods such as Week, Month, or Quarter, sometimes alternative periods are needed. This simple technique lets you split a year into periods with any number of days.


