Hi,I have an update problem which i'm not sure if its best dealt with a cursor. The Table has the following columnsid,claimreference,FromStatus,ToStatus,StartDate,EndDate1 DMARP00240 NULL New Claim 06/12/2004 21/12/20042 DMARP00240 NULL Application Form Sent 21/12/2004 17/05/20053 DMARP00240 NULL Application Form Received 17/05/2005 17/05/20054 DMARP00240 NULL Application Form Received 17/05/2005 23/05/20055 DMARP00240 NULL Information Requested 23/05/2005 23/05/20056 DMARP00240 NULL Information Requested 23/05/2005 13/06/20057 DMARP00240 NULL Information Received 13/06/2005 13/06/20058 DMARP00240 NULL Information Received 13/06/2005 12/07/20059 DMARP00240 NULL Information Under Review 12/07/2005 12/07/200510 DMARP00240 NULL Information Under Review 12/07/2005 18/07/200511 DMARP00240 NULL Assistant Manager Review 18/07/2005 18/07/200512 DMARP00240 NULL Assistant Manager Review 18/07/2005 18/07/200513 DMARP00240 NULL Offer Sent 18/07/2005 22/07/200514 DMARP00240 NULL Offer Accepted 22/07/2005 26/07/200515 DMARP00240 NULL Completed 26/07/2005 26/07/200516 DMARP00240 NULL Completed 26/07/2005 NULL17 DMARP01039 NULL New Claim 06/12/2004 21/12/200418 DMARP01039 NULL Application Form Sent 21/12/2004 10/01/200519 DMARP01039 NULL Application Form Received 10/01/2005 14/01/200520 DMARP01039 NULL Information Requested 14/01/2005 06/04/200521 DMARP01039 NULL Information Received 06/04/2005 06/04/200522 DMARP01039 NULL Information Received 06/04/2005 27/06/200523 DMARP01039 NULL Information Under Review 27/06/2005 27/06/200524 DMARP01039 NULL Information Under Review 27/06/2005 15/07/200525 DMARP01039 NULL Assistant Manager Review 15/07/2005 15/07/200526 DMARP01039 NULL Assistant Manager Review 15/07/2005 18/07/200527 DMARP01039 NULL Offer Sent 18/07/2005 22/07/200528 DMARP01039 NULL Offer Accepted 22/07/2005 26/07/200529 DMARP01039 NULL Completed 26/07/2005 26/07/200530 DMARP01039 NULL Completed 26/07/2005 NULL
The FromStatus needs to be filled using ToStatus column. Also the FromStatus column in row 17 has to remain NULL as the EndDate in row 16 was NULL.The result should be1 DMARP00240 NULL New Claim 06/12/2004 21/12/20042 DMARP00240 New Claim Application Form Sent 21/12/2004 17/05/20053 DMARP00240 Application Form Sent Application Form Received 17/05/2005 17/05/20054 DMARP00240 Application Form Received Application Form Received 17/05/2005 23/05/20055 DMARP00240 Application Form Received Information Requested 23/05/2005 23/05/20056 DMARP00240 Information Requested Information Requested 23/05/2005 13/06/20057 DMARP00240 Information Requested Information Received 13/06/2005 13/06/20058 DMARP00240 Information Received Information Received 13/06/2005 12/07/20059 DMARP00240 Information Received Information Under Review 12/07/2005 12/07/200510 DMARP00240 Information Under Review Information Under Review 12/07/2005 18/07/200511 DMARP00240 Information Under Review Assistant Manager Review 18/07/2005 18/07/200512 DMARP00240 Assistant Manager Review Assistant Manager Review 18/07/2005 18/07/200513 DMARP00240 Assistant Manager Review Offer Sent 18/07/2005 22/07/200514 DMARP00240 Offer Sent Offer Accepted 22/07/2005 26/07/200515 DMARP00240 Offer Accepted Completed 26/07/2005 26/07/200516 DMARP00240 Completed Completed 26/07/2005 NULL17 DMARP01039 NULL New Claim 06/12/2004 21/12/200418 DMARP01039 New Claim Application Form Sent 21/12/2004 10/01/200519 DMARP01039 Application Form Sent Application Form Received 10/01/2005 14/01/200520 DMARP01039 Application Form Received Information Requested 14/01/2005 06/04/200521 DMARP01039 Information Requested Information Received 06/04/2005 06/04/200522 DMARP01039 Information Received Information Received 06/04/2005 27/06/200523 DMARP01039 Information Received Information Under Review 27/06/2005 27/06/200524 DMARP01039 Information Under Review Information Under Review 27/06/2005 15/07/200525 DMARP01039 Information Under Review Assistant Manager Review 15/07/2005 15/07/200526 DMARP01039 Assistant Manager Review Assistant Manager Review 15/07/2005 18/07/200527 DMARP01039 Assistant Manager Review Offer Sent 18/07/2005 22/07/200528 DMARP01039 Offer Sent Offer Accepted 22/07/2005 26/07/200529 DMARP01039 Offer Accepted Completed 26/07/2005 26/07/200530 DMARP01039 Completed Completed 26/07/2005 NULL
Chet