ACC: Expressions to Count Yes, No, and Other ResponsesLast reviewed: April 2, 1997Article ID: Q101076 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. 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.
MORE INFORMATIONThe following expressions can be used in a report footer to count the occurrences of Yes, No, or Null in a field named YesNoField the with data type 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)) NullYou 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)) Example Using Sample Database Northwind.mdb (or NWIND.MDB in 1.x or 2.0)
|
Keywords : kbusage RptTotal
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |