Results 1 to 2 of 2
  1. #1
    athyeh is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    170

    Report built on Union Query; Summing Fields Separately on Report

    Hi Folks,

    I have a Union Query as follows:

    Code:
    SELECT qryAR.Operator, Sum(qryAR.P) AS SumOfP, qryAR.Pr
    FROM qryAR
    GROUP BY qryAR.Operator, qryAR.P
    UNION SELECT qryAA.Operator, Sum(qryAA.P) AS SumOfP, qryAA.Pr
    FROM qryAA
    GROUP BY qryAA.Operator, qryAA.Pr
    UNION SELECT  [qryNL].Operator, Sum([qryNL].["NL"]) AS SumOfP, "NL" AS Pr
    FROM [qryNL]
    GROUP BY [qryNL].Operator
    UNION SELECT qryESum.Operator, Sum(qryESum.SLID) AS SumOfP, "E" As Pr
    From qryESum
    GROUP BY qryESum.Operator;


    And have it presented in a report as follows:

    SumOfProduction Pr
    131 R
    180 NL
    20 E
    641 A
    972


    I am wondering, how can I manipulate the total at the bottom to show: R+NL+A OR E/(R+A+(NL*.2))?



    Thanks for all your replies and insight.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Expressions in textbox in footer section:

    =Sum(IIf(Pr="R" Or Pr="NL" Or Pr="A", SumOfProduction, 0))

    =Sum(IIf(Pr="E",SumOfProduction,0)) / (Sum(IIf(Pr="R" Or Pr="A",SumOfProduction,0)) + Sum(IIf(Pr="NL",SumOfProduction*0.2,0)))
    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. Summing specific fields on a report
    By spacekowboy in forum Access
    Replies: 4
    Last Post: 02-18-2014, 08:44 AM
  2. report built on query
    By Daryl2106 in forum Access
    Replies: 4
    Last Post: 12-09-2012, 07:07 PM
  3. Replies: 1
    Last Post: 09-13-2012, 09:31 AM
  4. Replies: 0
    Last Post: 03-14-2011, 08:38 AM
  5. Replies: 3
    Last Post: 05-21-2010, 03:57 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