Query Criteria

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
 
J

J. Goddard

What are trying to exclude? Just the values 1 and 7, or all numbers
beginning with 1 or 7?

John
 
J

John Vinson

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

DS

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
 
Top