Roger's Access Library Homepage
Forum Home Forum Home > Roger's Access Library > Roger's Download Samples
  New Posts New Posts RSS Feed - RunningSumInQuery.mdb (beginner)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login


Please consider donating $1 per sample downloaded, (find out why here)

RunningSumInQuery.mdb (beginner)

 Post Reply Post Reply
Author
Message Reverse Sort Order
carlrj View Drop Down
Admin Group
Admin Group


Joined: 31 Dec 2006
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote carlrj Quote  Post ReplyReply Direct Link To This Post Topic: RunningSumInQuery.mdb (beginner)
    Posted: 23 Jun 2016 at 7:04am
Updated 2010 version
--Roger Carlson



roger.j.carlson@gmail.com
Back to Top
Sponsored Links


Back to Top
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 20 Feb 2008
Status: Offline
Points: 249
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jun 2016 at 7:01am
 RunningSumInQuery.mdb
 
This sample illustrates how to create a Running Sum in a query.
It shows how to:
 1) Create a running sum over the entire table
or
 2) Create a running sum over a group.  In this case, the group is the OrderID field.
There are two methods shown here: Using a 1) correlated subquery and 2) DSum domain aggregate function.  The correlated subquery
is the faster method, but it returns a non-updateable recordset.  The Dsum method is slower, but the recordset is updateable.
HOWEVER, it should be noted that against a large dataset, neither method will be very fast!
Documentation included.

Download
Access 2003 (.mdb):
uploads/5/RunningSumInQuery2k.zip

Access 2010 (.accdb):
uploads/5/RunningSumInQuery2010.zip
Consider donating $1 per sample downloaded, find out why here.<
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down