I like to update a column based on a value of the next record:
resid startdate enddate weekday hours ----------------------------------------------- 2980
One way to do it is with a subquery:
UPDATE t1 SET enddate = (SELECT TOP 1 DATEADD(DAY, -1, startdate) FROM YourTable t2 WHERE t1.startdate < t2.startdate ORDER BY t2.startdate) FROM YourTable t1 WHERE t1.enddate is null
update TableName set enddate = dateadd(day,1,startdate)