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 2000 Forums
 SQL Server Development (2000)
 Accumulated budget question

Author  Topic 

de9625
Starting Member

17 Posts

Posted - 2002-08-16 : 11:15:59
What I want do is a accumulated budget.

The first question:
SELECT PERIOD, SUM(BUDGET)
FROM SALESBUDGET
GROUP BY PERIOD

Then I get a record set with 2 colums and 12 rows (one for each month)

Now I want to transform this budget in to an accumulated budget...
January = January
Februari = January + Feb
Mars = Jan + Feb + Mar
etc...

Should I do this with a temp table and/or with cursors or is there a function in SQLServer for this type of problem? I have read somewhere that u should stay away from cursor if u can..? Could anyone give me a hint on what to do?

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-08-16 : 11:29:57
running totals

Jay White
{0}
Go to Top of Page
   

- Advertisement -