Connecting Tech Pros Worldwide Help | Site Map

Query with Grouped Running Totals

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 07:52 AM
ddecoste
Guest
 
Posts: n/a
Default Query with Grouped Running Totals

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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.