null + number = null

  • Thread starter Thread starter Yair Sageev
  • Start date Start date
Y

Yair Sageev

Hello,

I have three calculated fields the first is a number that always is valid,
the second is the result of a sum query, and the third adds fields 1 and 2
together. The problem I am having is that if there are no records matching
in the dlookup sum query the value of that field is null, and the third
field does not display a number (which should simply be the value of the
first field).

I tried setting the default value of the 2nd field to 0, but it has no
effect.

Any ideas? Thanks in advance.
 
Check Access VB Help on the Nz() function which can convert Null to zero.
 
Yair said:
Hello,

I have three calculated fields the first is a number that always is
valid, the second is the result of a sum query, and the third adds
fields 1 and 2 together. The problem I am having is that if there
are no records matching in the dlookup sum query the value of that
field is null, and the third field does not display a number (which
should simply be the value of the first field).

I tried setting the default value of the 2nd field to 0, but it has no
effect.

Any ideas? Thanks in advance.

Null is *not* zero and anything involving Null will result in Null.

See the Nz function in help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top