Group By Date Part
To group by date part, use the GROUP BY clause and the EXTRACT() function. Pass EXTRACT() the date parts to isolate.
The results are grouped by year and month parts of the CloseDate field.
| CloseDate_Year | CloseDate_Month | cnt |
|---|---|---|
| 2014 | 12 | 1 |
| 2015 | 1 | 3 |
| 2015 | 2 | 1 |
| 2015 | 3 | 2 |
| 2015 | 4 | 2 |
| 2015 | 5 | 2 |
| 2015 | 6 | 1 |
| 2015 | 8 | 1 |
| 2015 | 10 | 1 |
| 2015 | 11 | 1 |