Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2011
    Posts
    3

    Question Unanswered: Sum Iif Statement

    I've been using the Sum iif statement for a few reports because it allows me to customize my report layout better than using regular queries.

    I have a list of clients who have received service hours but I need to total those numbers by month and county. I have a query that pulls the month (user selects which month with a list box), total hours and the counties.

    In the report I have the following statement in a text box to sum Jefferson county client hours:

    =Sum(IIf([county]="Jefferson",[total hours this payperiod],0))

    I need a similar total for all counties OTHER than Jefferson. Is there a way to update this statement so it pulls all the other counties without me having to list them in the statement? I'm worried that if the user adds another client from another county I dont have listed, the report will be inaccurate.

    As you can see, I'm pretty new at sql, so this is the best way I've found to total the hours on a report.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Does this work?


    =Sum(IIf([county]<>"Jefferson",[total hours this payperiod],0))
    Paul

  3. #3
    Join Date
    Oct 2011
    Posts
    3
    Thank you!

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Happy to help, and welcome to the site by the way!
    Paul

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
  •