two null fields?

G

Gabe

Hello,

I have two fields in a query, if they both are blank I don't want to see it.
But if one or the other is blank I want to see it.

Thanks.
 
J

Jeff Boyce

Gabe

Please keep in mind that "blank" means something different to humans than to
Access. If you look at a field or control and don't see anything, you count
that as "blank", right?

But Access distinguished among three possibilities ... 1. nothing is there
==> Null; 2. a zls (zero-length string, "") is there ==> ""; 3. some
number of "space"s are there ==> e.g., " "

You probably can't tell the difference by looking, but Access won't consider
#2 or #3 if you tell it to look for #1.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
A

Allen Browne

Gabe said:
I have two fields in a query, if they both are blank I don't want to see
it.
But if one or the other is blank I want to see it.

In query design, in the Criteria row under the first field, enter:
Is Not Null

The next row below the Criteria row is titled Or (at the left.) In this Or
row, below your 2nd field, enter:
Is Not Null

If you have other criteria in the query as well, you may need to repeat them
on the Or row also to get the results you want. (That's if you want them
applied to both cases.)
 

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

Top