Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get Running Total in Query ? 1

Status
Not open for further replies.

breukelen

Technical User
Oct 31, 2001
54
NL
I have something like this in query:

Id Descr Amount
1 AAAA 100
2 BBBB 200
3 CCCC 300

I like to get :

Id Descr Amount Running T.
1 AAAA 100 100
2 BBBB 200 300
3 CCCC 300 600

Help is very much appreciated,thanks in advance.

Gunter
 
I have a similar problem with an append query. I am creating new order records in a table based on a table of purchase orders imported from a customer. Some of the orders are sales of goods, and some are sales of services.

All of them are assigned work order numbers (an autonumber field) but only the sales of services are assigned an rma number. Previously, all of these orders were hand-entered and an RMA was chosen on a form when needed, but the volume is growing to the point where that is no longer practical.

How can I conditionally increment each record? In other words, for each record being created, if POType="repair", RMA=DMax("[RMA]","WorkOrders")+1, without having it return the same RMA number for all records in the query?

Thanks a lot for any help you can give!
 
I figured out the answer to my own problem: use the GetRows Method to populate an array from a SQL statement with the conditions I need, then loop through the array. I knew there had to be a way to do it. It just seems I can't do it in the append query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top