如何从日期字段仅按月分组(而不按日分组) ?
下面是我的日期字段:
2012-05-01
下面是我当前的 SQL:
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 Closing_Date, Category