query search for 'is not null' produces null fields. why?

G

Guest

Using Access 2000 sorting in a query to eliminate blank text fields.
Criteria "Is Not Null" does not eliminate blank fields. Why?
 
K

Ken Snell \(MVP\)

If the field's property is set to disallow zero length strings, then my
answer should not be the source of your problem.

So let's start at the beginning. Give us some details about the table, and
about the query. Let's see the SQL string of your query.

Let's try changing the
Is Not Null
to
<> ""
in your query. What results do you get?

Let's also try adding a calculated field to your query with a criterion
expression:
TestLength: Len([NameOfFieldWithProblem] & "")

Criteria: 0

What results do you get?
 
G

Guest

Much thanks! <>"" produced good results. Problem solved. (but I still
winder why not null didn't work.)

Ken Snell (MVP) said:
If the field's property is set to disallow zero length strings, then my
answer should not be the source of your problem.

So let's start at the beginning. Give us some details about the table, and
about the query. Let's see the SQL string of your query.

Let's try changing the
Is Not Null
to
<> ""
in your query. What results do you get?

Let's also try adding a calculated field to your query with a criterion
expression:
TestLength: Len([NameOfFieldWithProblem] & "")

Criteria: 0

What results do you get?

--

Ken Snell
<MS ACCESS MVP>

Mike33 said:
how do I handle blank text fields which do not allow zero lenght strings?
 
K

Ken Snell \(MVP\)

Is Not Null did not work because there are indeed empty strings in those
"blank" fields, regardless of the property setting to not allow ZLS values.
Is it possible that the property was changed after these data had already
been entered?

--

Ken Snell
<MS ACCESS MVP>


Mike33 said:
Much thanks! <>"" produced good results. Problem solved. (but I still
winder why not null didn't work.)

Ken Snell (MVP) said:
If the field's property is set to disallow zero length strings, then my
answer should not be the source of your problem.

So let's start at the beginning. Give us some details about the table,
and
about the query. Let's see the SQL string of your query.

Let's try changing the
Is Not Null
to
<> ""
in your query. What results do you get?

Let's also try adding a calculated field to your query with a criterion
expression:
TestLength: Len([NameOfFieldWithProblem] & "")

Criteria: 0

What results do you get?

--

Ken Snell
<MS ACCESS MVP>

Mike33 said:
how do I handle blank text fields which do not allow zero lenght
strings?

:

Probably because those fields contain an empty string, not a Null
value.

--

Ken Snell
<MS ACCESS MVP>

Using Access 2000 sorting in a query to eliminate blank text fields.
Criteria "Is Not Null" does not eliminate blank fields. Why?
 

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