Adding

F

Frank

I have 5 numbers that I need to total V1,V2,V3,V4,VOT.
Sometimes VOT is Null. If I leave VOT blank, Total does
not work. If I put a number in VOT it works. What can I
do to fix this problem.

Frank
 
R

Rosco

Frank,
assuming this is an expression in a query, Try the following:
Expr1: Nz([V1],0)+Nz([V2])+Nz([V3],0)+Nz([V4],0)+Nz([VOT],0)

The Nz function replaces a null value in any of the fields with a number, in
this case 0. This allows access to complete the equation.

Hope this helps.
 
D

Dirk Goldgar

Frank said:
I have 5 numbers that I need to total V1,V2,V3,V4,VOT.
Sometimes VOT is Null. If I leave VOT blank, Total does
not work. If I put a number in VOT it works. What can I
do to fix this problem.

Most operators applied to Null return Null as a result, so 27 + Null = Null.
You can use the Nz function to replace a Null value with 0:

=Nz(V1, 0)+Nz(V2, 0)+Nz(V3, 0)+Nz(V4, 0)+Nz(VOT, 0)
 
Top