Something like this?;WITH cteSource(theMonthName, theMonthNumber, Defect)AS ( SELECT DATENAME(MONTH, [Date]) AS theMonthName, DATEPART(MONTH, [Date]) AS theMonthNumber, Defect FROM dbo.Table1 WHERE [Status] = 'Closed')SELECT theMonthName, SUM(CASE WHEN Defect = 'TV' THEN 1 ELSE 0 END) AS TV, SUM(CASE WHEN Defect = 'ADSL' THEN 1 ELSE 0 END) AS ADSL, SUM(CASE WHEN Defect = 'IP' THEN 1 ELSE 0 END) AS IPFROM cteSourceGROUP BY theMonthName, theMonthNumberORDER BY theMonthNumber
N 56°04'39.26"E 12°55'05.63"