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)
 Using select statement to rename a field name.

Author  Topic 

bbcdavid
Starting Member

1 Post

Posted - 2009-09-10 : 21:12:15
Hi

I'm looking at a budget view that has period ID as part of the field name/column header. I was wanting to change the column header by looking up the month value in the period ID table.

E.g.
In this example I want to look up 26 & return the Month/Year from the Period ID Table, changing the Column header from Budget26 to Aug2009

Period ID table has two columns PerID & PerDate
PerID PerDate
25 31/07/2009 12:00:00 AM
26 31/08/2009 12:00:00 AM
27 30/09/2009 12:00:00 AM

Thanks
David


Cheers
David

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-13 : 13:53:31
are you asking for crosstabbing based on PerDate field? if yes, have a look at syntax of PIVOT
Go to Top of Page
   

- Advertisement -