ACC2: How to Replace Nulls with Zeros in Crosstab Query ResultsLast reviewed: June 20, 1997Article ID: Q132140 |
The information in this article applies to:
SUMMARYThis article demonstrates two methods you can use to replace null values with zeros in crosstab query results.
MORE INFORMATIONWhen you run a crosstab query to summarize data in a row-and-column format, you may have blank (or null values) in some cells. You can replace the nulls with zeros by using the IIF() function or the custom NullToZero()function that is included in the sample database NWIND.MDB within an expression in the Crosstab column of the QBE grid. NOTE: If you want to use the custom NullToZero() function in your database, you can copy or import it from the Utility Functions module in the sample database NWIND.MDB and paste it into a new or an existing module in your database.
Using the IIF() FunctionTo replace nulls with zeros using the IIF() function, follow these steps. CAUTION: Following the steps in this example will modify the sample database NWIND.MDB. You may want to back up the NWIND.MDB file, or perform these steps on a copy of the NWIND database.
Using the NullToZero() FunctionTo replace nulls with zeros using the custom NullToZero() function, follow these steps:
REFERENCESFor more information about the IIf() function, search for "IIf," and then "IIf Function" using the Microsoft Access Help menu. Microsoft Access "User's Guide," version 2.0, Chapter 12, "Advanced Queries," pages 279-285
|
Additional query words: fill empty
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |