Assuming ID's are sequential and assuming that EffectDate is of type DATETIME, you can do the following.SELECT
a.Id,
a.DeptNo,
a.EffectDate,
COALESCE(DATEADD(dd, -1, b.EffectDate),'99991231') AS EndingDate,
Rate
FROM
DeptRates a
LEFT JOIN DeptRates b ON a.ID+1 = b.ID;