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



The information in this article applies to:

  • Microsoft Access 2000

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).

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).

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.

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]))

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.

Modification Type:MajorLast Reviewed:6/29/2004
Keywords:kbprb kbProgramming KB308631