Results 1 to 9 of 9
  1. #1
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255

    Running Sum in Detail?

    I have a monthly management report which includes the names of the employee, # in the group they are responsible for and a MTD total of contacts they have made to their group. I want to include a YTD total in this report but the running sum function doesnt work and I have tried a DSUM but that gives me the same running total on each employee line for the entire group. I want a running total of contacts for each employee, so if in January the employee had 100 contacts and in February had 50 then my total should be 150 for that employee.. Any ideas?

    My DSUM was: dsum("[Portfolio Contacts]","Relationship Mgt","datepart('m',[Date])<=" & [Month Number] & "")

    I have a group on Month Number (since Access doesnt understand April 2012 is not first), and Employee Dept then a sort on Employee Last Name.. The running sum for the month works fine in the Month Number Footer where i have the total group summary.

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What is the grouping heirarchy?

    Show the DSum expression.

    Want to provide db for analysis? Follow instructions at bottom of my post
    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.

  4. #4
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    Group Heirarchy is Month Number, then Employee Dept. I have no group on the actual Employee.

    =DSum("[Portfolio Contacts]","Relationship Mgt","[Month Number]<=" & [Month Number] & "")

    db is too large to upload..

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Did you make copy, remove records (leave a few for testing), run compact & repair, zip?
    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.

  6. #6
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    I only uploaded the qry i was using to try and get the running sum by employee for each month.
    Attached Files Attached Files

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Need to also include the employee in the DSum criteria.

    ContactRunSum: DSum("[Contacts]","Contacttbl","[HRP Lastname]='" & [HRP Lastname] & "' AND [Created Month]<=" & [Created Month] & "")

    And if you have multiple years, will also have to include criteria for the year.

    Domain aggregate functions don't care about the filter or grouping criteria of the query they are in.

    If you use domain aggregate function in a textbox on a filtered form or report, have to include the same filter criteria in the function if you want the data to have the same restrictions.
    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.

  8. #8
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255
    Thanks.. i thought that was the case; i just couldn't figure out how to incorporate employee in the DSum. I wont have multiple years.

    Instead of putting this DSum in the query, would it be more efficient to put it in the report? Not sure i understand "If you use domain aggregate function in a textbox on a filtered form or report, have to include the same filter criteria in the function if you want the data to have the same restrictions." DSum is a relatively new function to me.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    DSum is one member of a family of domain aggregate functions - DAvg, DMax, DLookup etc.

    As example, if you want only the records for July and that filter is in the the query/report and you want the DSum to also be limited to July but the DSum datasource is the original table, then DSum must also have the filter criteria.
    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.

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

Similar Threads

  1. Detail in columns
    By marcusp in forum Reports
    Replies: 1
    Last Post: 03-28-2012, 03:41 PM
  2. More detail required
    By coach32 in forum Queries
    Replies: 3
    Last Post: 12-05-2011, 05:42 AM
  3. Replies: 1
    Last Post: 12-04-2011, 02:16 AM
  4. Detail form
    By karuppasamy in forum Access
    Replies: 1
    Last Post: 06-10-2011, 02:08 AM
  5. Detail form
    By karuppasamy in forum Access
    Replies: 5
    Last Post: 05-26-2011, 07:39 AM

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