Connecting Tech Pros Worldwide Forums | Help | Site Map

Query with Grouped Running Totals

ddecoste
Guest
 
Posts: n/a
#1: Nov 13 '05
I have done a bunch of looking but I am confused as to the correct way
I should proceed with this problem.

I have query that returns: It is sorted by ordnum then, linenum, then
date and it creates a table called Temptable.

ordnum linenum qtyord Date qtyship
1234 1 500 2/1/05 150
1234 1 500 2/2/05 200
1234 2 300 2/5/05 130
1234 2 300 2/7/05 170
1245 1 600 2/2/05 200
1245 1 600 2/3/05 150
1245 1 600 2/4/05 150

I would like to change update this table with running totals with each
record to something like this

ordnum linenum qtyord Date qtyship qtyremain
1234 1 500 2/1/05 150 350
1234 1 500 2/2/05 200 150
1234 2 300 2/5/05 130 170
1234 2 300 2/7/05 170 0
1245 1 600 2/2/05 200 400
1245 1 600 2/3/05 150 250
1245 1 600 2/4/05 150 100

I have tried using the DSum function but I just cant seem to get the
query correct. Would this be easier if it was done in VB.

Any help would be greatly appreciated. If anymore info is needed
please let me know. This is done in Access 2000

Thank you,

Darren


Closed Thread