Using the Not criteria

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

Guest

In my query, I need to select records where the field (OPL_Type) is not 1 or
2. In the criteria row I typed Not ("1" Or "2").

I ran and saved the query. It looked good.

I went back into the query and the criteria was missing from the OPL_Type,
and a new field [(CORP_PROF_WIN]) with FALSE in the criteria row was created.
CORP_PROF_WIN is the table where the fields are coming from. What happened?
I am confused.
 
hi,

I am not sure what happened in your case, but change you condition to:
[OPL_Type] not in('1','2')

hope this helps,
geebee
 
JS said:
In my query, I need to select records where the field (OPL_Type) is not 1 or
2. In the criteria row I typed Not ("1" Or "2").

I ran and saved the query. It looked good.

I went back into the query and the criteria was missing from the OPL_Type,
and a new field [(CORP_PROF_WIN]) with FALSE in the criteria row was created.
CORP_PROF_WIN is the table where the fields are coming from. What happened?
I am confused.


The query design grid sometimes misunderstands what you
intended, especially when you use an expression like that.
To take advantage of any index you may have on the field,
use this instead:

Not "1" And Not "2"

Are you sure the field is a text field? If it's a numeric
type, drop the quotes.
 
Thank you. I will give it a try.

Marshall Barton said:
JS said:
In my query, I need to select records where the field (OPL_Type) is not 1 or
2. In the criteria row I typed Not ("1" Or "2").

I ran and saved the query. It looked good.

I went back into the query and the criteria was missing from the OPL_Type,
and a new field [(CORP_PROF_WIN]) with FALSE in the criteria row was created.
CORP_PROF_WIN is the table where the fields are coming from. What happened?
I am confused.


The query design grid sometimes misunderstands what you
intended, especially when you use an expression like that.
To take advantage of any index you may have on the field,
use this instead:

Not "1" And Not "2"

Are you sure the field is a text field? If it's a numeric
type, drop the quotes.
 
Back
Top