Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting a query

Status
Not open for further replies.

cochise

Technical User
Mar 27, 2001
171
US
I have a query and I need to set the criteria so all records with a field value of 15 and 18 in Source do not show up? I put in the criteria

Not Like 15

and that worked, but I don't know how to make it so 18s are not included as well.

Any help?
 
cochise,

The Like operator is for strings.

In QBE your criteria should be &quot;<> 15&quot; (no quotes).

In code:

sql = &quot;select * from table where [field] <> 15;&quot;

hth,
Wayne
 
Hi,

In your criteria, use:

Not In (15,18)

Obviously you can add & remove any numbers you like and it is very easy to read. If the field you are putting the condition against is a text field, each entry in the list will need to be wrapped in quotes (ie (&quot;15&quot;,&quot;18&quot;)

the &quot;Like&quot; condition should be reserved for when wildcards are to be used.


Cheers

Steve

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top