A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

two null fields?



 
 
Thread Tools Display Modes
  #1  
Old January 14th, 2010, 11:56 PM posted to microsoft.public.access.queries
Gabe
external usenet poster
 
Posts: 83
Default two null fields?

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.
  #2  
Old January 15th, 2010, 12:03 AM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default two null fields?

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.

"Gabe" wrote in message
news
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.



  #3  
Old January 15th, 2010, 03:56 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default two null fields?

"Gabe" wrote in message
news
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.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.