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  

Show items not null



 
 
Thread Tools Display Modes
  #1  
Old July 16th, 2008, 10:05 PM posted to microsoft.public.access.queries
mattc66 via AccessMonster.com
external usenet poster
 
Posts: 210
Default Show items not null

I have created a query.

SELECT qryItemsWith26Chars.ITEM, qryItemsWith26Chars.DESCRIPTION,
qryItemsWith26Chars.[25Char]
FROM qryItemsWith26Chars
WHERE (((qryItemsWith26Chars.[25Char]) Is Not Null));

However when I run the query all items show even the ones that are null or
blank. What can I do to make this work?

Thanks
Matt

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200807/1

  #2  
Old July 16th, 2008, 10:41 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Show items not null

Null is not the same as blank. Null is totally void but blank is a 'zero
lenght string.'
Try this --
WHERE qryItemsWith26Chars.[25Char] Is Not Null AND
qryItemsWith26Chars.[25Char] "";
--
KARL DEWEY
Build a little - Test a little


"mattc66 via AccessMonster.com" wrote:

I have created a query.

SELECT qryItemsWith26Chars.ITEM, qryItemsWith26Chars.DESCRIPTION,
qryItemsWith26Chars.[25Char]
FROM qryItemsWith26Chars
WHERE (((qryItemsWith26Chars.[25Char]) Is Not Null));

However when I run the query all items show even the ones that are null or
blank. What can I do to make this work?

Thanks
Matt

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200807/1


  #3  
Old July 16th, 2008, 11:00 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Show items not null

I've also seen cases where spaces made it seem like the field was null. I do
a select query on the field and see if the criteria below returns any
records. Even if it returns records with something visible in the field, that
could be a problem.

Like " *"
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"KARL DEWEY" wrote:

Null is not the same as blank. Null is totally void but blank is a 'zero
lenght string.'
Try this --
WHERE qryItemsWith26Chars.[25Char] Is Not Null AND
qryItemsWith26Chars.[25Char] "";
--
KARL DEWEY
Build a little - Test a little


"mattc66 via AccessMonster.com" wrote:

I have created a query.

SELECT qryItemsWith26Chars.ITEM, qryItemsWith26Chars.DESCRIPTION,
qryItemsWith26Chars.[25Char]
FROM qryItemsWith26Chars
WHERE (((qryItemsWith26Chars.[25Char]) Is Not Null));

However when I run the query all items show even the ones that are null or
blank. What can I do to make this work?

Thanks
Matt

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200807/1


  #4  
Old July 16th, 2008, 11:30 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Show items not null

mattc66 via AccessMonster.com wrote:

I have created a query.

SELECT qryItemsWith26Chars.ITEM, qryItemsWith26Chars.DESCRIPTION,
qryItemsWith26Chars.[25Char]
FROM qryItemsWith26Chars
WHERE (((qryItemsWith26Chars.[25Char]) Is Not Null));

However when I run the query all items show even the ones that are null or
blank. What can I do to make this work?



Blank is different from Null as is a Zero Length String.
It's unlikely that you actually have a field with just a
space character. OTOH, if the field has it Required and
AllowZeroLength properties set to Yes, then you probably
have ZLS in those records that appear "blank". You can
check for both Null and ZLS by using an expression like:

WHERE 25Char & "" = ""

--
Marsh
MVP [MS Access]
  #5  
Old July 17th, 2008, 04:42 PM posted to microsoft.public.access.queries
mattc66 via AccessMonster.com
external usenet poster
 
Posts: 210
Default Show items not null

Thanks that worked.

KARL DEWEY wrote:
Null is not the same as blank. Null is totally void but blank is a 'zero
lenght string.'
Try this --
WHERE qryItemsWith26Chars.[25Char] Is Not Null AND
qryItemsWith26Chars.[25Char] "";
I have created a query.

[quoted text clipped - 8 lines]
Thanks
Matt


--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200807/1

 




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:52 AM.


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