Show items not null

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

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
 
K

KARL DEWEY

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] <>"";
 
J

Jerry Whittle

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 said:
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 said:
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
 
M

Marshall Barton

mattc66 said:
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 & "" = ""
 
M

mattc66 via AccessMonster.com

Thanks that worked.

KARL said:
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. said:
I have created a query.
[quoted text clipped - 8 lines]
Thanks
Matt
 
Top