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
 Analysis Server and Reporting Services (2005)
 sum up number on the time line

Author  Topic 

roy mm
Yak Posting Veteran

62 Posts

Posted - 2007-07-22 : 06:57:55
Hello.
I have a query That look like that:

"SELECT COUNT(*),MONTH FROM TABLE GROUP BY MONTH"

The result is:
Jun 2
Feb 2
Mar 3
Apr 0
May 5

What I want to have is that every month will sum up the previous month and him self so in the end I will be able the create a graph wuth those numbers:

Jun 2
Feb 4
Mar 7
Apr 7
May 13

Any ideas on how to start?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-22 : 09:02:58
1) Do it in front-end!
2) Your resultset does not match your query.
3) How do you want your data to be sorted?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

roy mm
Yak Posting Veteran

62 Posts

Posted - 2007-07-22 : 09:07:52
I found a great query in another forum:

SQL> select b.sal,sum(a.sal) as cum_sal
2 from emp a,emp b
3 where a.rowid <= b.rowid
4 group by b.rowid,b.sal
5 /


Thanks.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-22 : 09:45:19
Where is the RowID column in your original post?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -