Empty Data field that does not return zero lenth

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to filter on a data field that is emply using double quotes "" in
the criteria box which does not work. I have also use Len(Myfield) on the
entire table and get 122 records which I know have data and their lenth but
the other 500 or so records have no lenth returned. What is in these records?
How can I clean them up so that I can use "" and return all these records?
Thanks!
 
I am trying to filter on a data field that is emply using double quotes "" in
the criteria box which does not work. I have also use Len(Myfield) on the
entire table and get 122 records which I know have data and their lenth but
the other 500 or so records have no lenth returned. What is in these records?
How can I clean them up so that I can use "" and return all these records?
Thanks!

NULL - no value, nothing entered, undefined - is not the same as a
zero length string "".

To find records where the field is truly empty, use a criterion of

IS NULL

I believe that 2003 defaults Text field's Allow Zero Length property
to True; previous versions do not, and storing "" into a field will
actually store a NULL.

John W. Vinson[MVP]
 
Thanks for your explicit example here. It saved me posting another entry for
this type question. I kept trying Isnull and getting syntax and argument
errors. Never thought of separating the IS from the NULL.
 
Thanks for your explicit example here. It saved me posting another entry for
this type question. I kept trying Isnull and getting syntax and argument
errors. Never thought of separating the IS from the NULL.

That's certainly a common source of confusion! There *is* in fact a VBA
function, which can be called from a Query, named IsNull: IsNull(variable)
returns True if variable is a NULL, and false if it has a non-null value.

However, the SQL query syntax (established before there *was* such a thing as
VBA) is

WHERE <field or expression> IS NULL


John W. Vinson [MVP]
 

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

Back
Top