select
SUM(1) as total
,DATENAME(mm,dateon) as month
,category
from tableA
where dateon between '2012-05-01' and '2012-06-30'
group by DATENAME(mm,dateon),category
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/