Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Adding the Values of Fields Returns a Blank Result If Some of the Fields Contain Null Values


View products that this article applies to.

This article was previously published under Q308631
Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

↑ Back to the top


Symptoms

When you try to add the values of two fields in a database, and one of the fields contains null values in a few records, the result of the calculation for those records appears blank (null).

↑ Back to the top


Cause

This behavior occurs because the result of a calculation that involves a null value is also null. A null value is not the same as a value of zero (0); instead, think of a null value as an unknown value. Adding an unknown value to a number yields an unknown result.

↑ Back to the top


Resolution

To work around this behavior, create an expression that uses the Nz() function to convert null values to zeros, for example, (Nz([Field1])+Nz([Field2]))

↑ Back to the top


More information

For more information about handling null values, either search the Access Help index for "blank fields, null values", or ask the Access 2000 Office Assistant.

↑ Back to the top


Keywords: KB308631, kbprb, kbprogramming

↑ Back to the top

Article Info
Article ID : 308631
Revision : 2
Created on : 6/29/2004
Published on : 6/29/2004
Exists online : False
Views : 253