Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NZ 1

Status
Not open for further replies.

desperatemeasures

Technical User
Sep 10, 2002
50
US
I am trying to make a field on a report display a zero if it is null. In the control source of the field on the report, I have put the following: =nz([Work Units])

This is giving me #Error, what am I doing wrong?

 
Hi

: =nz([Work Units])

Is the control by chance named [Work Units] ?

If yes try renaming it to (say) txtWorkUnits leaving the source as it is Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Hi

Thanks for the reply, but I dont follow!

The Field on the report is called Work Units.

Can you explain a bit more!

Thanks
 
Hi

Then rename the Field on the report, that is what I am saying.

You cannot have the control (field) called the same as one of the patameters in the : =nz([Work Units])

Just rename the control on the report and it will work
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Hi!

Try it like this:

=IIf(IsNull([Work Units]) = True, 0, [Work Units])

hth
Jeff Bridgham
bridgham@purdue.edu
 
The ACTUAL answer is that you are using NZ wrongly.

Nz ALWAYS requires two parameters

So you need

=Nz([Work Units],0)

The first part tells Nz what to test, and what to return if the test is Not Null

The second part tells Nz what to return if the first part IS NULL.


( Use =Nz(strValueName,"") to return an empty string in text based work )



'ope-that-'elps.


G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top