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
 Transact-SQL (2000)
 Cumulative summation

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-11-29 : 23:57:38
abdullah Sarhan writes "I have in my database a stock transaction table , I try to create monthly stock report view which create a cumulative summation per each month as following
Stock Code mont qty
M.Car 08/2005 10
A.Car 08/2005 2
C.Car 08/2005 10
M.Car 09/2005 18
M.Car 10/2005 8



Can You please help me in my case"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-30 : 03:03:03
Is this?

Select StockCode,mont,sum(qty) from stock group by StockCode,mont

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -