Results 1 to 14 of 14
  1. #1
    Deputy91 is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2025
    Posts
    4

    Question Trying to total a calculated field form a group footer in another group footer

    I am trying to total the FLSA Cash for all of the pay weeks for one employee (group) above. FLSA Cash is a calculated fields using AVG([Work Week]), SUM([OTCASH], SUM([OTCOMP]), SUM([LEAVE]) and AVG([Hourly])


    I believe that I may have to setup a query to do the calculation, but how do I do that with fields from the report?




    I also want a grand total for all employees at the end of the report. I think if I get past the first calculated field issue, everything else will fall into place.




    the report is grouped by employee then by pay week. HELP!
    Click image for larger version. 

Name:	Report View.png 
Views:	18 
Size:	55.4 KB 
ID:	53185

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Deputy91 is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2025
    Posts
    4
    Yes sorry for the crosspost, I wasn't getting any response here.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Just to let people know. Weekends tend to be quiet.
    I would expect a control with sum attributes, it I always need to test it out.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Deputy91 is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2025
    Posts
    4
    Yes, maybe my question should be how do i setup a query to calculate controls in the report, then total them in the footer

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Try the wizard. That will actually do it for you. Then you can tweak to your hearts content.
    NB: Any sort order to the source is ignore by reports. It si done within the report.

    Here is one I created quickly with the wizard on my data of one of my dbs.
    Attached Files Attached Files
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You said "FLSA Cash" - should that be "FLSA Cost"?

    Not understanding your difficulty.
    Using same aggregate functions calc in employee and report footers should accomplish this.
    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
    Deputy91 is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2025
    Posts
    4
    SOLVED, thank you - A member walked me thorough the solution.

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Quote Originally Posted by Deputy91 View Post
    SOLVED, thank you - A member walked me thorough the solution.
    So please pass on your solution.
    That is what, after all, these forums are for, not just to take and leave.
    The whole idea is to share solutions, not keep them to yourself, even if you work them out yourself.

    I suspect I also know as to who is doing that 'private help'. That helps nobody else, as they cannot see the solution, but the helper thinks he is the bees knees.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  10. #10
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,818
    Hi Gasman
    The OP did not want to upload his database to the Forum and also had no idea on how to create a query .
    All I did was correct his table fields which had been set as text Data Currency.

    His original table data shown.

    I then showed him how to change the Record Source of the Report to a Select Statement as shown below:-

    Code:
    SELECT
        [CSEA Data 2016 - Time Type Columns].[Event Date],
        [CSEA Data 2016 - Time Type Columns].[Employee ID],
        [CSEA Data 2016 - Time Type Columns].[Employee Name],
        [CSEA Data 2016 - Time Type Columns].[Title Description],
        [CSEA Data 2016 - Time Type Columns].[Pay Week],
        [CSEA Data 2016 - Time Type Columns].TRC,
        [CSEA Data 2016 - Time Type Columns].LEAVE,
        [CSEA Data 2016 - Time Type Columns].OTCOMP,
        [CSEA Data 2016 - Time Type Columns].OTCASH,
        [CSEA Data 2016 - Time Type Columns].[Work Week],
        [CSEA Data 2016 - Time Type Columns].[HOURLY       ],
        (Nz ([Work week], 0) -40) - Nz ([leave], 0) AS D,
        IIf(
            [Work Week] < 40,
            Nz ([Leave], 0) + Nz ([OTCash], 0) + Nz ([OTComp], 0),
            0
        ) AS LessThan40,
        IIf(
            [Work Week] > 40,
            Nz ([Leave], 0) + Nz ([OTCash], 0) + Nz ([OTComp], 0),
            0
        ) AS GreaterThan40,
        IIf([OTCASH] < [D], [OTCASH], [D]) AS Hrs,
        [Hrs] * [Hourly] * 1.5 AS [FLSA Costs]
    FROM
        [CSEA Data 2016 - Time Type Columns];
    
    He was then able to get the Total of the "FLSA Costs" as required in the Footer of the Report.
    Attached Thumbnails Attached Thumbnails TableFields.png  

  11. #11
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    OMG what a table naming convention.
    Thanks for explaining, it could help others, you never know.

    NB: Only one table?, you can exclude it's name for the fields.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Query builder will add table name prefix to each field as shown.

    I would advise not to use spaces nor special characters/punctuation in naming convention.
    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.

  13. #13
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Question.
    On my phone, but what if the work week is 40?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  14. #14
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,818
    Hi Gasman
    Good spot. I was just going with the OP's calculations and had missed that one.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-07-2021, 09:10 AM
  2. Replies: 1
    Last Post: 05-22-2017, 05:59 AM
  3. Replies: 2
    Last Post: 12-30-2014, 01:32 PM
  4. Replies: 5
    Last Post: 01-04-2014, 02:29 PM
  5. Replies: 2
    Last Post: 12-21-2013, 02:09 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