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 |
|
neeraj1401
Starting Member
36 Posts |
Posted - 2009-06-02 : 05:22:39
|
| I have a table status_history in which has the following data id prior_statusId new_status_id date_modified 94535 NULL 1 2008-01-29 10:07:54.55794535 1 2 2008-04-29 14:12:13.59094535 2 3 2008-08-30 15:35:12.00094535 3 4 2008-010-30 15:56:07.14094535 4 5 2008-012-30 16:09:50.423I want to write a query which will give me following result Id status_on_31_03_2008 status_on_31_06_2008 status_on_31_09_2008 status_on_31_12_200894535 1 2 3 4 thanks in advance Neeraj |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-02 : 05:46:09
|
You will have to use dynamic SQL for this.See www.sommarskog.se E 12°55'05.63"N 56°04'39.26" |
 |
|
|
neeraj1401
Starting Member
36 Posts |
Posted - 2009-06-02 : 05:49:56
|
| thanks for reply. I can not not use dynamic query as I have only select grant on database i cannot create any object. |
 |
|
|
SQLRatankalwa
Starting Member
42 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|