Expression answer not showing up in report

proballin

Registered User.
Local time
Today, 04:29
Joined
Feb 18, 2008
Messages
105
I have a simple expression in a report I created:

= [query1] - [query2].

The results being returned in the queries are based off of the COUNT function. When a number is returned for both queries then it works fine. The problem is whenever query 1 or 2 do not return a number then the report is blank. What I would like is that when query 1 or 2 does not return a number it should be as if its zero. For example if query 2 doesnt return a number then it should be:

=[query1] - 0.

Any suggestions?
 
Try ...

Code:
= Nz([query1],0) - Nz([query2],0).
-dK
 
Thanks!!!

Really quick...what exactly does that statement do?
 
According to Access Help: You can use the Nz function to return zero, a zero-length string or another specified value when a Variant is Null. For example, you can use this function to convert a Null value to another value and prevent it from propagating through an expression.

Syntax: Nz(variant [, valueifnull ] )

In this instance, when one of your expressions returns a null, it propagates so your whole expression is null - thus, you do not see anything in the report. This takes the null and turns it into a 0.

-dK
 

Users who are viewing this thread

Back
Top Bottom