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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to find value not including...

Status
Not open for further replies.

caman74

IS-IT--Management
Jan 1, 2005
67
NO
Hello.

I do have a query that will show values in a listbox.
I would like to set the criteria, to find all values from the field "status" that not has the value "OK".
Or if you like;
I would like a criteria that finds the values "B" or "S" and the fields with no values (the ones that still are left blank), and not the fields with the value "OK"

I've tried with the criterias:
1) "B" OR "S" OR ""
2) "B" OR "S" OR " "
3) "B" AND "S" AND ""
4) Not like "OK"

But none of them worked...

Any ideas??

Chris
 
SELECT
tblValues.Value

FROM
tblValues

WHERE
((Not (tblValues.Value)="OK"));


Sam_F
"90% of the problem is asking the right question.
 
In the SQL pane of the query designer window:
WHERE Nz([Status],'') In ('B','S','')

Another way:
WHERE Nz([Status])<>'OK'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thank you for both of your sugestions.

Now my list shows the info I want :)

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top