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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-05-05 : 15:08:37
|
| Prabir writes "In a table 'A', I have records as follows:ID Entry -date Withdraw-date000001 08/18/2003 08/19/2003000001 08/18/2003 11/04/2003000001 08/19/2003 11/04/2003000001 11/25/2003 12/01/2003000001 11/25/2003 01/05/2004000001 01/05/2004000009 08/18/2003 02/05/2004000009 10/03/2003 02/05/2004Now, I want to check "Entry-date" with Prior "withdraw-date".If Entry-date < Prior "withdraw-date" then I want to movePrior "withdraw-date" to current "Entry-date".Say for example, lets consider first 2 rows.On row 2 , we have 08/18/2003 as entry date.On row 1 , we have 08/19/2003 as prior Withdraw-date.As Row 2 Entry date < Row 1 Withdraw-date, I want to move08/19/2003 as row 2's Entry date and so on...Can it be done with a single SQL or I need to create a cursor to do it.Please help me.Thank YouPrabir" |
|
|
gpl
Posting Yak Master
195 Posts |
|
|
|
|
|