"NOT" Query also excluding null data - why?

G

Guest

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"
 
G

Guest

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.
 
D

Duane Hookom

You need to add the "" to the field in the grid.

Field: PricingRemarks:[Pricing Remarks] & ""
Criteria: Not "Comp Only"

--
Duane Hookom
MS Access MVP


SteveS said:
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.
 

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

Similar Threads


Top