ACC2000: Expressions to Count Yes, No, and Other ResponsesID: Q209505
|
This article lists sample expressions that you can use to count the occurrences of Yes, No, or Null in a field with a Yes/No data type.
You can use the following expressions in a report footer to count the occurrences of Yes, No, or Null in a field named YesNoField with a data type of Yes/No:
Expression Sums What
--------------------------------------------
=Sum(IIF([YesNoField],1,0)) Yes
=Sum(IIF([YesNoField],0,1)) No
=Sum(IIF(Not[YesNoField],1,0)) No
=Sum(IIF(IsNull[YesNoField],1,0)) Null
You can also create a related expression to count a specific value in
a field. For example, the following sample expression counts all
occurrences of the value 3 in a field called MyField.
=Sum(IIF([MyField]=3,1,0))
=Sum(IIF([Discontinued],1,0))
=Sum(IIF([Discontinued],0,1))
Additional query words: inf
Keywords : kbdta RptTotal
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: May 13, 1999