Pretty dense sql query

Soldato
Joined
8 Mar 2005
Posts
3,686
Location
London, UK
Hopefully a very simple one:
SELECT monthyear, COUNT(*) AS callcount, SLAPass
FROM vw_RAA_RA
WHERE (TICKET_ID_ IS NOT NULL) AND (Actual_Date >= DATEADD(month, DATEDIFF(month, 0, GETDATE()) - 11, 0))
GROUP BY DATEADD(month, DATEDIFF(month, 0, Actual_Date), 0), monthyear, SLAPass

The above query produces 3 columns as follows:

Monthyear,callcount,SLAPAss
Jan2012,10,No
Jan2012,8,Yes
...

However, what I want to do is crosstab, I suspect, the result as follows:

Monthyear,callcountFail,callcountPass
Jan2012,10,8
...
Any guidance most welcome, I'm even less than a total noob when it comes to sql so please be gentle.

Cheers, Paul.
 
Back
Top Bottom