April 8, 2004 at 8:39 am
Hi,
I 've got a query where where my result consists of a [Product Code] column, followed by three fields ([Month1],[Month2],[Month3]), which is the past 3 month's total movement, for that a product.
My table only has the following fields: [Dated],[prodct Code],[Movement].
I use case statments to get the required results, which is perfect.
To finish off my query, I want to assign field headers for results which looks some like: [March 2004],[April 2004],[May 2004] etc, by using declared variables or similar.
Does anyone know how to assign column headers at runtime?
Robert
April 8, 2004 at 10:34 am
Well this can be done using Dynamic SQL however you may want to get yourself clear if you want to go with dynamic SQL or not and it also requires a temp table inside a SP so if you are ok with Dynamic SQL I will post the script for it.
Thanks.
Prasad Bhogadi
www.inforaise.com
April 9, 2004 at 4:40 am
Please post that script, I'll give it a try.
Thanks
Robert
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply