You basically need to use dynamic SQL to generate the columns for the pivot. Jeff wrote an article on it here:
http://www.sqlservercentral.com/articles/Crosstab/65048/
Seth Phelabaum
Consistency is only a virtue if you're not a screwup. 😉
Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]