August 22, 2008 at 3:06 pm
I have data in a table as shown below (Before) that I need to use t-SQL to dynamically transpose/format into the format in (After) below. Any assistance will be appreciated.
Thanks.
Before:
AccountDOS
45732/27/2006
84895/31/2007
63641/19/2006
63642/13/2006
635310/24/2006
63538/20/2007
635311/27/2006
63532/5/2007
63533/27/2007
63531/4/2007
57512/12/2007
45679/27/2006
45672/8/2007
45677/5/2007
45673/20/2007
45673/21/2006
45672/20/2007
45676/13/2006
87423/14/2007
87428/2/2007
87422/22/2007
After:
AccountDOS1DOS2DOS3DOS4DOS5DOS6
45732/27/2006
84895/31/2007
63641/19/20062/13/2006
635310/24/20068/20/200711/27/20062/5/20073/27/20071/4/2007
57512/12/2007
45679/27/20062/8/20077/5/20073/20/20073/21/20062/20/20076/13/2006
87423/14/20078/2/20072/22/2007
August 22, 2008 at 6:45 pm
Check out this article for some ideas: http://qa.sqlservercentral.com/articles/T-SQL/63681/
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply