Query Criteria

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I'm trying to set a criteria in a query. Its on a number field.

Not Like 1 or 7
Not Like 1 or Not Like 7
Not Like 1;7

None of These work, any help appreciated.
Thanks
DS
 
What are trying to exclude? Just the values 1 and 7, or all numbers
beginning with 1 or 7?

John
 
I'm trying to set a criteria in a query. Its on a number field.

Not Like 1 or 7
Not Like 1 or Not Like 7
Not Like 1;7

None of These work, any help appreciated.
Thanks
DS

LIKE is a text operator which works with wildcards. It can be used for
number fields but that's not typical, and not the best way to handle
numeric values.

Guessing that what you want is to exclude all records with either 1 or
7 in this field, and include all other values, try a criterion of

NOT IN (1, 7)

John W. Vinson[MVP]
 
John said:
LIKE is a text operator which works with wildcards. It can be used for
number fields but that's not typical, and not the best way to handle
numeric values.

Guessing that what you want is to exclude all records with either 1 or
7 in this field, and include all other values, try a criterion of

NOT IN (1, 7)

John W. Vinson[MVP]
That worked!
Thanks
DS
 

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