I only read yourfirst post. So, the code below I think will perform the update you require. But, the performance is probably going to be not so good.DECLARE @Table TABLE ( AmendID INT, PredID INT, StartDT DATETIME, EndDT DATETIME, Cost INT, Rank INT)INSERT @TableSELECT 1 ,0 ,'20060401','20060406',5 ,1UNION ALL SELECT 1 ,3 ,Null ,Null ,5 ,2UNION ALL SELECT 1 ,9 ,Null ,Null ,4 ,3UNION ALL SELECT 1 ,10 ,Null ,Null ,6 ,4UNION ALL SELECT 1 ,12 ,Null ,Null ,3 ,5UNION ALL SELECT 4 ,0 ,'20060401','20060403',2 ,1UPDATE TSET StartDT = -- Get the EndDT for the first record (SELECT EndDT FROM @Table AS A WHERE A.AmendID = T.AmendID and PredID = 0) -- Add the sum of the Costs to get the new StartDT, -- excluding the rows own cost + ( SELECT COALESCE(SUM(Cost), 0) FROM @Table AS B WHERE B.AmendID = T.AmendID AND B.Rank < T.Rank AND PredID <> 0 ), EndDT = -- Get the EndDT for the first record (SELECT EndDT FROM @Table AS A WHERE A.AmendID = T.AmendID and PredID = 0) -- Add the sum of the Costs to get the new EndDT, -- including the rows own cost + ( SELECT COALESCE(SUM(Cost), 0) FROM @Table AS B WHERE B.AmendID = T.AmendID AND B.Rank <= T.Rank AND PredID <> 0 )FROM @Table AS TWHERE PredID > 0 AND StartDT IS NULLSELECT *FROM @Table