Home > Archive > Microsoft SQL Server forum > June 2005 > Sql Query with one column as the name to another column









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Sql Query with one column as the name to another column
marlene

2005-06-24, 3:23 am

Hi There

Does anyone know how to create a query or do something in a stored
procedure to output one column as the other columns name? The output I
want is something like this:

CurrentMonth(Jun 05) May 05 April 05
ItemCode Units Price Units Price Units Price

A 10 10.00 5 8.00 12 12.00

The month displayed as the column names will be in fields
CurrentMonthDesc, SalesHistoryDesc1, SalesHistoryDesc2 etc. Now I want
these to be the headings to Current, SalesHistory1, SalesHistory2 etc.

Please help!

Kind Regards
Marlene

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com