Results 1 to 4 of 4
  1. #1
    pjd71's Avatar
    pjd71 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Apr 2013
    Location
    Sunset Beach, NC
    Posts
    15

    Want to Perform the Sum of a Field if another Field is Yes/N0

    I am creating a report from 1 query that comes from 1 table. The report is grouped by "Cost Code". I am trying to publish 2 sums in each "Cost Code" footer. I want to sum the total of a field called "TOT of REQ" that only has a "Yes" (checked box) in another field called "Funded". Then, I want to sum the total for the "No" (unchecked box). I would will have the sums in groups by Cost Code and a final total at the end of the report. I have a Cost Code footer that sums the total of all the "TOT of REQ", but need to break it down to yes/no fields.
    I have looked to use either IIF or sum expression, however, it has been a few years since I have done this sort of work.
    Something close to what I am looking for:
    COST Code


    Item TOT of REQ Funded
    Bed $1,452.00 Yes (Checked Box)
    Window $3,000.00 No (Unchecked)
    Door $200.00 Yes

    Total of Funded: $1,652.00
    Total of Unfunded $3,000.00



    Any help would be great.

    Patrick
    Last edited by pjd71; 04-02-2013 at 07:37 PM. Reason: Hit enter key and submitted

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Try this type of thing:

    =Sum(IIf(Funded = True, [TOT of REQ], 0))

    I deleted your other 2 threads on the same topic.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pjd71's Avatar
    pjd71 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Apr 2013
    Location
    Sunset Beach, NC
    Posts
    15
    Thank you, I used this, which I believe is the same. Definitely coming back to this site for help and possibly help others.

    Thanks
    Patrick D.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No problem, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

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