• Formula in Report or Query

    • This topic has 2 replies, 2 voices, and was last updated 16 years ago.
    Author
    Topic
    #460438

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #1164432

      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.

    Viewing 0 reply threads
    Reply To: Formula in Report or Query

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: