How can I group only by month from a date field (and not group by day)?
Here is what my date field looks like:
2012-05-01
Here is m
By Adding MONTH(date_column) in GROUP BY.
MONTH(date_column)
GROUP BY
SELECT Closing_Date, Category, COUNT(Status)TotalCount FROM MyTable WHERE Closing_Date >= '2012-02-01' AND Closing_Date <= '2012-12-31' AND Defect_Status1 IS NOT NULL GROUP BY MONTH(Closing_Date), Category