Connecting Tech Pros Worldwide Help | Site Map

Query with Grouped Running Totals

  #1  
Old November 13th, 2005, 08:52 AM
ddecoste
Guest
 
Posts: n/a
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate totals for period of time Mayhem05 answers 4 September 20th, 2006 08:45 PM
Query with Grouped Running Totals ddecoste answers 0 November 13th, 2005 08:52 AM
calculating a percent of total in a query mhodkin@comcast.net answers 2 November 13th, 2005 07:42 AM
calculating totals in a query Paul Mendez answers 3 November 13th, 2005 02:05 AM