display everything but

  • Thread starter Thread starter Dennis Villareal
  • Start date Start date
D

Dennis Villareal

i want to run a query and display all the results except a certain text. we
have different branches - like CPT, CRT, CSS, COH, CRY - i want to show
everything but CRY - what do i need to put in the Criteria field?
 
Not Like CRY. If you wanted to just display, say, CPT you would put Like CPT
 
Its better to use the inequality operator <>, so in the criteria row:

<> "CRY"

If its possible the column could be empty (Null) in any rows in the table,
and you also want those rows returned, put the following on the next criteria
row down:

Is Null

criteria on separate rows in query design view equate to an OR operation.
This is because Null is neither equal or unequal to anything, so Null <>
"CRY" in fact evaluates to Null, not to True and the row would not be
returned. This why Is Null must be used to test for Null.

To display only those which are CRY just put "CRY" in the criteria row and
omit the Is Null from the second row.

The Like operator is for pattern searching, and is used with wildcard
characters, e.g.

Like "*CRY*"

would find CRY, cryogenic, lacrymal (yes it’s a real word, a variation of
the more common lachrymal), decry etc. It would also find "Don't cry for me
Argentina", "Cry me a river" etc., i.e anything which includes "cry" either
as a word or part of a word.

Ken Sheridan
Stafford, England
 

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