Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Dynamic Columns?

Author  Topic 

tariqadib
Starting Member

1 Post

Posted - 2011-11-25 : 07:27:00
Hi
I need to write a query that has Years as columns. I need it to be dynamic i.e. it should show the number of years based on a start year and an end year received via parameters.

Adib

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-25 : 08:43:18
you need this

http://beyondrelational.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -