• LAG/LEAD in SQL 2012 would be the best bet I think.

    http://technet.microsoft.com/en-us/library/hh231256.aspx

    Otherwise, have you investigated the windowing functions?

    http://technet.microsoft.com/en-us/library/ms189461.aspx