Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a report that displays an account name, then three fields that show if there is a problem in one or more of three areas. For example, if an account is missing a current financial statement, there would be an X in the balance sheet column. If the account type is incorrect, there would be an X in that column. In the underlying data, all three of the fields have either an N or a Y in that field.

    In my report footer, I want to count the number of problems for each of the three types of errors. In Excel, I would say =CountIf(CellRange,"N"). In Access, I want it to count field [BalSheet] if the value is N. Access does not seem to have a "countif" type function for reports, or I cannot find it.

    If I do a simply count, I get the total number of records which is not what I want.

    What am I missing?

    Thanks for your help.

    Nancy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can use

    =Abs(Sum([BalSheet]="N"))

    [BalSheet]="N" is either True = -1 or False = 0. Sum adds the True values as -1's. Abs converts negative to positive.

  3. #3
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Perfect!

    Thank you, Hans, for your quick response.

    Nancy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •