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.
Author |
Topic |
Demitemi
Starting Member
2 Posts |
Posted - 2008-08-22 : 17:25:05
|
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.Will like the DOS order to be from earlier to later if possible. Any assistance will be appreciated.Thanks.Before:Account DOS 4573 2/27/2006 8489 5/31/2007 6364 1/19/2006 6364 2/13/2006 6353 10/24/2006 6353 8/20/2007 6353 11/27/2006 6353 2/5/2007 6353 3/27/2007 6353 1/4/2007 5751 2/12/2007 4567 9/27/2006 4567 2/8/2007 4567 7/5/2007 4567 3/20/2007 4567 3/21/2006 4567 2/20/2007 4567 6/13/2006 8742 3/14/2007 8742 8/2/2007 8742 2/22/2007 After: Account DOS1 DOS2 DOS3 DOS4 DOS5 DOS6 4573 2/27/2006 8489 5/31/2007 6364 1/19/2006 2/13/2006 6353 10/24/2006 8/20/2007 11/27/2006 2/5/2007 3/27/2007 1/4/2007 5751 2/12/2007 4567 9/27/2006 2/8/2007 7/5/2007 3/20/2007 3/21/2006 2/20/2007 6/13/20068742 3/14/2007 8/2/2007 2/22/2007 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|