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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zero (0) versus Blank (null)

Status
Not open for further replies.

Freckles

Technical User
May 1, 2000
138
US
Normally I am trying to get a zero instead of a null in a query. BUT, this time I need a null. Anyone know how? ::) Deb Koplen
deb.koplen@verizon.com

A person can stand almost anything except a succession of ordinary days.
 
I think that I did not state my question clearly enough. I need a blank/null OUTPUT, not a 0 (Zero) output. In other words, if x - y = 0, I want a null in the output. ::) Deb Koplen
deb.koplen@verizon.com

A person can stand almost anything except a succession of ordinary days.
 
Add a new field like this to your query and use it instead of [YourField]:
Code:
=IIf([YourField]=0,"",[YourField])

If it's 0, the field will be blank (null), otherwise it will contain the YourField value....

HTH
 
Dear CosmoKramer,Dear Freckles


to receive NULL it should be

=IIf([YourField]=0,NULL,[YourField])

Which is something else than "" being a String without value

to receive a blank it should be

=IIf([YourField]=0," ",[YourField])

where " " is a String with a blank

HTH

Regards

Astrid
 
If the desired result is to interrogate this field at some point for NULL values, then Sawatzky's first example is correct. If it's to simply display nothing, then there are many ways to accomplish this......
 
Thanks to all! But let me tell you what I am doing: I generate the query in Access and then export it to Excel where I then link to it and then generate a chart. I want the to have blanks because any formating will give me "something". (Would it not be nice if we could do all of this in Access!) ::) Deb Koplen
deb.koplen@verizon.com

A person can stand almost anything except a succession of ordinary days.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top