"NOT" Query also excluding null data - why?

S

SteveS

I am running a query that will NOT include selected text in a field derived
from a combo box in a form.

However, the query automatically excludes all null data in that same field.

The criteria looks like this:
Criteria:
Not "Comp Only"

It is excluding records that are blank in that field when I run the query.

Why? and how do I see the records where the field is null?

Thank you.
 
D

Duane Hookom

Null has no value so you can't compare it to a value. You can change your
where clause to something like:
WHERE [YourField] & "" Not "Comp Only"
 
S

SteveS

Thanks for the fast response...
Still having problems...
I get the error reading:
"The expression you entered contains invaladid syntax; You may have entered
an invalaid operator, such as the + operator, in an expression without a
corresponding operand."

The name of my record is "Pricing Remarks:"

It looks like this in the query design view:
Field: Pricing Remarks
Criteria: WHERE [Pricing Remarks:] & "" Not "Comp Only"

What am I doing wrong?

Thanks agian.


Duane Hookom said:
Null has no value so you can't compare it to a value. You can change your
where clause to something like:
WHERE [YourField] & "" Not "Comp Only"

--
Duane Hookom
MS Access MVP
--

SteveS said:
I am running a query that will NOT include selected text in a field derived
from a combo box in a form.

However, the query automatically excludes all null data in that same
field.

The criteria looks like this:
Criteria:
Not "Comp Only"

It is excluding records that are blank in that field when I run the query.

Why? and how do I see the records where the field is null?

Thank you.
 
Top