Question : SQL Pivot

Hello, I'm trying to make an SQL Pivot to pull the count for each month for 3 years (2008-2010)

snip included.

The problem is, it's not collecting the count.  This is the first time I've done SQL Pivot so go easy on me.  

I can get the total for each month, but not separated by year.

I would like it to be:

MONTH - 2008 - 2009 - 2010
1------------xxxx-----xxxx----xxxx
2------------xxxx-----xxxx----xxxx
3------------xxxx-----xxxx----xxxx
4------------xxxx-----xxxx----xxxx

Help is appreciated.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
SELECT [MONTH], [2008], [2009], [2010]
FROM
(SELECT ERPEquipID
FROM Device INNER JOIN Account ON Device.AccountID = Account.AccountID
WHERE Device.ERPEquipID Is Not Null And (Device.ERPEquipID) Not Like ' ') st
PIVOT
(
COUNT(st.ERPEquipID)
FOR ERPEquipID IN ([MONTH], [2008], [2009], [2010])
) AS pvt

Answer : SQL Pivot

OK, try this then:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
SELECT [MONTH], [2008], [2009], [2010]  
FROM  
(SELECT Month(Device.FirstAuditDate) [MONTH], Year(Device.FirstAuditDate) [Year], ERPEquipID  
FROM Device INNER JOIN Account ON Device.AccountID = Account.AccountID  
WHERE Device.ERPEquipID Is Not Null And (Device.ERPEquipID) Not Like ' ') st  
PIVOT  
(  
COUNT(st.ERPEquipID)  
FOR [Year] IN ([[2008], [2009], [2010])  
) AS pvt
Random Solutions  
 
programming4us programming4us