Inserting next row field into first row field meeting conditions using SQL : I need to insert corresponding row EditedDate to NextDate and so on such that when status = Passive for ID=502 corresponding row EditedDate i.e 2017-07-31 14:17:14.000  should be inserted into NextDate for ID=502  and When status = Passive for last line for ID=1702 then same EditedDate i.e  2017-08-01 17:30:55.000 should be inserted into NextDate  of last line for ID=1702
[Image Here][1]

  [1]: https://i.stack.imgur.com/e09Ki.jpg