Conditional Rolling Sum

JoeC_Glenmark

Registered User.
Local time
Today, 14:28
Joined
May 8, 2013
Messages
10
Hey Guys,

Am a total newbie, so this one should be real easy to solve for you folks.

Have a table/query result
Sr.NO Name Amt.Tot Amt.Needed Date
1 Mark 100 24 1/1/12
2 Mark 100 80 1/5/12
3 Tom 150 12 4/5/12
4 Tom 150 45 6/5/12
5 Joe 50 23 3/3/13

Need to add a field which is Amount.LEft so that the table looks like this

Sr.NO Name Amt.Tot Amt.Needed Amt.Left Date
1 Mark 100 24 76 1/1/12
2 Mark 100 80 -4 1/5/12
3 Tom 150 12 138 4/5/12
4 Tom 150 45 93 6/5/12
5 Joe 50 23 27 3/3/13

The last field is Amt.Tot - Amt.Needed and this should roll over and subtract for all transactions of Mark, then restart again for Tom and then again for Joe. Let me know if there is any confusion on that.


Please let me know how to.

Regards,
Joe

Apologies for the repeat questions
 
Last edited:
Perhaps the discussion in this thread is headed in the direction you want. You will need to read through the whole thread.
 
I guess im too much of a newbie to figure it out from that, though I guess the link is fine.

Somebody help if possible else i guess ill figure it out eventually..

Thanks!

Regards,
Joe
 
Guys, can someone help me with this code. Still struggling with the same.
 

Users who are viewing this thread

Back
Top Bottom