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
 General SQL Server Forums
 New to SQL Server Programming
 PIVOT......

Author  Topic 

matta0990
Starting Member

44 Posts

Posted - 2011-11-24 : 05:13:06
I'm trying to pivot this table and i just carnt get it to work.

Date 1 Date 2 price day code

23/11/2011 23/11/2011 1.00 0D EUR
23/11/2011 30/11/2011 1.20 1W EUR
23/11/2011 23/11/2011 1.30 0D GBP
23/11/2011 23/11/2012 1.40 1Y EUR
23/11/2011 23/12/2011 1.50 1M EUR
23/11/2011 23/05/2012 1.60 6M EUR
23/11/2011 24/11/2011 0.65 1D GBP
23/11/2011 23/02/2012 1.69 3M EUR

im tryig to pivot so that the EUR and GBP code as the field headers with the price like so

Date 1 Date 2 EUR GBP day

23/11/2011 23/11/2011 1.00 0D
23/11/2011 30/11/2011 1.20 1W
23/11/2011 23/11/2011 1.30 0D
23/11/2011 23/11/2012 1.40 1Y
23/11/2011 23/12/2011 1.50 1M
23/11/2011 23/05/2012 1.60 6M
23/11/2011 24/11/2011 1.47 1D
23/11/2011 23/02/2012 1.69 3M

I just carnt get it to work can anyone help please

thanks Matt

matta0990
Starting Member

44 Posts

Posted - 2011-11-24 : 05:15:27
sorry formatting changed when i posted, so basically i want EUR and GBP at the drop with only the relivent price for that code in the coloums
Go to Top of Page
   

- Advertisement -