Results 1 to 3 of 3
  1. #1
    BringTheR41n is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    36

    Running Sum


    I am trying to convert all of my data from excel files to a single access database. Im trying to work on a way to organize my bills for my company. I have a table in excel that has specific formulas that apply only to a certain row but the formula is carried throughout the column, ie: the daily balance = previous daily balance + deposits - bill. and the number it gives stays with that one row and all of my previous balances are still in the column. I have read about running sums and have no idea on how to use/apply them and wondered if there is any way that they apply to my circumstance. Is there a way to have this in an access query/report that reads almost like a bank statement? i also have bills that are due on a future day in the month and they display a projected daily balance.
    Also I check my bills and bank account daily for my actual balance available and would like to incorporate the daily balance in another column. would there be a way that the function: if(date=today,totalbalance,0), would be a valid way to accomplish that?
    Thanks for the help.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    Related thread https://www.accessforums.net/queries...ces-45273.html

    Bing: Access bank ledger
    http://office.microsoft.com/en-us/te...001017534.aspx

    Why build from scratch? OTS programs available, like Quicken and QuickBooks.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Running sums should be done on a report, trying to do them in queries is extremely memory intensive and, as your database grows, become very time consuming to run.

    So let's say you are trying to print a statement for a particular person for a particular time period, your report would consist of 3 things.

    1. Determining what their balance was before they started the period.
    2. Add credits, subtract debits during the period
    3. Calculate the ending balance from the sum of the first two.

    Item 1 can be determined by it's own AGGREGATE query with a criteria of < (less than) the starting date of the period which can be set up as a criteria in a query of something like:

    < "#" & [Enter the Start Date] & "#"

    or if you are trying to inherit a date range form a form

    < "#" & [forms]![formname]![startdate] & "#"

    if you've correctly created an aggregate query you should be able to come up with their balance just prior the period you're reporting on.

    Then you can create a second query that shows the detail for the customer and link in the query you just ran (or create a report/subreport structure) and in the DETAIL section you'd have a field where the CONTROL SOURCE was something like

    =[Deposit] + [Bill]

    and in the RUNNING SUM property put OVER GROUP (this will follow the same grouping structure as your report so if you are grouping by customer it will also)

    So you can show your deposits, your bills and the running sum can include their 'starting balance' for the period as well.

    Then finally in your report or group footer (depending on how you're doing your processing) you can have a final formula for the 'ending balance'

Please reply to this thread with any new information or opinions.

Similar Threads

  1. running sum
    By chavez_sea in forum Queries
    Replies: 1
    Last Post: 10-09-2013, 03:13 PM
  2. Running queries, VIA VB, but not running in Order
    By mike02 in forum Programming
    Replies: 6
    Last Post: 06-01-2013, 07:07 AM
  3. Running sum by date
    By Ray67 in forum Queries
    Replies: 25
    Last Post: 10-16-2012, 02:19 PM
  4. Running Sum
    By rpgowned in forum Queries
    Replies: 2
    Last Post: 08-30-2011, 10:17 AM
  5. Running total
    By lololthis in forum Queries
    Replies: 5
    Last Post: 06-21-2011, 04:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums