Results 1 to 5 of 5
  1. #1
    rkalapura is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York
    Posts
    69

    Running sum in Query

    Is it possible to have running sum of one field in a union query? I can have it in the report by addition an unbound field "cumulative". My ultimate aim is to find the min and max value of the "Cumulative" total from the query. I am getting error when I use min max in report unbound field.



    Any help on this is highly appreciated.

    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Not easily. Use a report for this calculation. Textboxes on report have a RunningSum property. Min and Max should work in group or report header/footer.

    Not sure what you mean by min and max of the cumulative.
    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
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722

  4. #4
    rkalapura is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    New York
    Posts
    69

    Min Max in Query

    EmplMinMax.pdf
    Quote Originally Posted by orange View Post
    Hai Orange,

    Yes it is. I have made the union query and created temporary table sorted on review date (Date joined/Left) as you did with VB code all in access 2010. I have an additional field called "Factor" in the UQ, and assign value +1 to it, whenever employee join the company and -1, when an employee leave company. "Flag" field added to understand the process more clear. I have an employee count on the starting day, getting from a query. Using the temptable, I made a report to get the daily Employee count using the cumulative total of Field "Factor". See a sample report enclosed in PDF.

    Now I want to find out the Min and Max value of Emplcount in the report. I made an unbound field in report footer and give Min([Report]![EmpMinMax]![Emplcount]) as control source. Same way another unbound field for Max. But these are giving error. No value showing up in these fileds.

    Appreciate your help to get the values, either in report or in querry.

    Thank you very much for your assistance. Whatever you made in VB, I just copied to Access.

    God Bless You.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    I must be missing something. I showed an example. You modified something - I'm not sure what. Then I asked you to post your database.

    Now I see a new thread. What exactly has changed? Do you have a new requirement? Did the code not work for you? Can you post a copy of your database?

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

Similar Threads

  1. Query with a running sum
    By is49460 in forum Queries
    Replies: 3
    Last Post: 09-07-2013, 11:11 PM
  2. Query not running
    By gwboolean in forum Queries
    Replies: 2
    Last Post: 08-07-2012, 02:38 PM
  3. Re-running the same query
    By ashok in forum Access
    Replies: 5
    Last Post: 06-19-2012, 10:41 AM
  4. Running a query
    By Toollady in forum Queries
    Replies: 1
    Last Post: 06-04-2012, 03:28 PM
  5. Running a query
    By scarlettera in forum Queries
    Replies: 3
    Last Post: 04-04-2011, 01:59 PM

Tags for this Thread

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