Update column value with another rows value SQL 2008

I have a table T, with three columns ID, BusDate, Volume
I need to update the previous row's Volume column with the next days Volume
ID, Busdate are the primary keys to the table, there could be gaps in busdates because of holidays such as Sat and Sun

ID                  BusDate                  Volume
5974            2015-04-28            28600713.00000000
5974            2015-04-29            14950920.00000000
5974            2015-04-30            14886845.00000000
5974            2015-05-01            25157302.00000000
5974            2015-05-04            50363634.00000000


To arrive at this
ID                  BusDate                  Volume
5974            2015-04-28            14950920.00000000
5974            2015-04-29            14886845.00000000
5974            2015-04-30            25157302.00000000
5974            2015-05-01            50363634.00000000
5974            2015-05-04
LVL 1
countrymeisterAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Data DudeCommented:
I'm not at my SQL 2012 box so I can't whip up a T-SQL solution for you, but this speaks to the LEAD and LAG functions introduced in 2012.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
countrymeisterAuthor Commented:
As I have pointed in my question subject line, the SQL Server version I am using is 2008, o no lead lag available there.
awking00Information Technology SpecialistCommented:
Lead and Lag functions sure make this task easier but, without them try this -
update t set volume = (select updtvol from
(select t1.id, t1.busdate, t1.volume, t2.volume as updtvol from
 (select id, busdate, volume,
  row_number() over (partition by id order by busdate) rn
  from t) t1
 left join
 (select id, busdate, volume,
  row_number() over (partition by id order by busdate) rn
  from t) t2
 on t1.rn = t2.rn - 1) x
where t.volume = x.volume);
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.