Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, I am struggling with the syntax for forumla. In a table I have a combo, say X with options of A, B or C. I need, either in my query or report, to do a count of X where number of records = A, if not A then 0. How would I construct this, I have been playing with:

    =iif([qryName![X]="A",count([X]),0) but this isn't liked.


    Thanks, Darren.

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

    =Abs(Sum([X]="A"))

    [X]="A" is either True = -1 or False = 0. So the sum counts all occurrences of "A" as -1. The Abs (absolute value) function removes the minus sign.

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sweet Hans, thank you.

Posting Permissions

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