Running sum 
Author Message
 Running sum

Can someone show me some code for doing a running sum on a field in a
recordsete?

The problem I'm having is my code doubles the amount of the first record.



Fri, 22 Nov 2002 03:00:00 GMT  
 Running sum
Brucio:

To do this you need a unique key in your query, and you need to use a
subquery to create the running sum.  An example of a field that uses a
subquery to create the running sum would be:

RunningSum: (Select Sum (OrderTotal) FROM [Orders] as Temp WHERE
[Temp].[OrderID] <= [Orders].[OrderID])

HTH
--
Steve Arbaugh
ATTAC Consulting Group
http://ourworld.compuserve.com/homepages/attac-cg/acgsoft.htm


Quote:
> Can someone show me some code for doing a running sum on a field in a
> recordsete?

> The problem I'm having is my code doubles the amount of the first record.



Fri, 22 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to do a Running Sum with Only Negatives

2. Running sums on a FORM??

3. Running sum question again

4. Running Sums in Forms

5. How to Count with Running Sum

6. Running Sums with queries

7. Running Sum

8. Creating a running sum query

9. running sum

10. Help!, running sum on form!

11. Article: How to create a running sum on a form

12. How to do Running Sum in a Query

 

 
Powered by phpBB® Forum Software