G
Guest
Hi,
I have a table with ProductID, TrxNo, RecvQty, IssueQty.
ProductID, TrxNo, RecvQty, IssueQty
===================
Item1,Trx01,100,0
Item1,Trx02,0,50
Item1,Trx03,100,0
Item2,Trx04,50,0
Item2,Trx05,0,50
Item2,Trx06,100,0
What I would like to do is to contructs a query where it produce something
like the following:-
ProductID, TrxNo, RecvQty, IssueQty, RunningSum
===================
Item1,Trx01,100,0,100 <-- Running sum start from 100
Item1,Trx02,0,50,50 <-- Running sum becomes 50 after 100-50
Item1,Trx03,100,0,150 <- Running sum becomes 150 after 50+100
Item2,Trx04,50,0,50 <-Running sum start all over again
Item2,Trx05,0,50,0
Item2,Trx06,100,0,100
Anyone has any ideas on how to do it?
Thank You.
mfwoo
I have a table with ProductID, TrxNo, RecvQty, IssueQty.
ProductID, TrxNo, RecvQty, IssueQty
===================
Item1,Trx01,100,0
Item1,Trx02,0,50
Item1,Trx03,100,0
Item2,Trx04,50,0
Item2,Trx05,0,50
Item2,Trx06,100,0
What I would like to do is to contructs a query where it produce something
like the following:-
ProductID, TrxNo, RecvQty, IssueQty, RunningSum
===================
Item1,Trx01,100,0,100 <-- Running sum start from 100
Item1,Trx02,0,50,50 <-- Running sum becomes 50 after 100-50
Item1,Trx03,100,0,150 <- Running sum becomes 150 after 50+100
Item2,Trx04,50,0,50 <-Running sum start all over again
Item2,Trx05,0,50,0
Item2,Trx06,100,0,100
Anyone has any ideas on how to do it?
Thank You.
mfwoo