Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Need to add previous value + current value

Author  Topic 

vasss
Starting Member

2 Posts

Posted - 2011-06-13 : 06:23:03
Hi,

I need a query to add previous field value + current field value.

Example :
tabel name : testing

date total
2010-11-04 2
2010-12-04 4
2010-13-04 2
2010-14-04 6

what i need is

date total cum_total
2010-11-04 2 2
2010-12-04 4 6
2010-13-04 2 8
2010-14-04 6 14

please help me asap.

Thanks,
Vasss


SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-06-13 : 07:04:43
See your own answer here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=126701



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -