From: Toby on
I'm trying to create a pivot statement, however, the columns are dynamic in
the sense that one month one of the columns could be used and the next it's
not... Does anyone know of any good links to handle this situation.

Thanks in advance
From: Erland Sommarskog on
Toby (Toby(a)discussions.microsoft.com) writes:
> I'm trying to create a pivot statement, however, the columns are dynamic
> in the sense that one month one of the columns could be used and the
> next it's not... Does anyone know of any good links to handle this
> situation.

I have some information on
http://www.sommarskog.se/dynamic_sql.html#Crosstab that may help you.


--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx