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 2005 Forums
 Transact-SQL (2005)
 dynamic pivot

Author  Topic 

abhiram.bhise
Starting Member

2 Posts

Posted - 2011-01-25 : 00:43:21
Hello friends,

Need some help with dynamic pivots.

i want to write a procedure for creating a dynamic pivot.

The original table has following columns.

Item No. | Item description | Qty in inventory | Date
SKU101 | Item 101 | 2300 | 21/01/2011
SKU102 | Item 102 | 3300 | 22/01/2011
SKU103 | Item 103 | 4600 | 23/01/2011
SKU104 | Item 104 | 2300 | 21/01/2011
SKU106 | Item 106 | 2800 | 21/01/2011

Desired output is - When entered a particular date with the procedure, we need the status of 'Qty in inventory' till current date.

Item No. | Item description | Qty in inventory | 21/01/2011 | 22/01/2011 | ..till current date in DB.

thanks in advance for your time.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-01-25 : 03:42:26
Refer this
http://beyondrelational.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

abhiram.bhise
Starting Member

2 Posts

Posted - 2011-01-25 : 07:19:26
Hello Madhivanan sir,
thanks a lot ! :)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-01-25 : 07:27:21
quote:
Originally posted by abhiram.bhise

Hello Madhivanan sir,
thanks a lot ! :)


You are welcome

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -