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

Query Criteria

Status
Not open for further replies.

Danielle17

Technical User
Apr 17, 2001
102
US
I'm trying to run a query using a criteria expression. The query contains all the info for a 'customer phone book'. In the table that the query is run from there is a column called RepCode. If that column has a 999 in it then I don't want that record displayed in the query. I've tried using Not "999" and Not 999. But if I do that then it doesn't retrieve the records where the column is blank.(If the customer doesn't have a repcode the column is left blank)I think this has something to do with null values. So I tried Not "999" and Is Not Null....that returns all the previous records and just one of the records with a null value. Anybody know what I'm doing wrong?
 
opps...I meant to say Not "999" and Is Null.....that returns zero records
 
Hi Danielle, try this: Not "999" Or Is Null

Let me know if that helps

Dawn
 
when you use "and" you are asking it to return records where the value in the field meets both criteria..."or" will return values when it matches any of the criteria.
 

Is RepCode numeric or a string?

Try <> &quot;999&quot; if a string or <> 999 if numeric. Terry Broadbent
Please review faq183-874.

&quot;The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge.&quot; - Daniel J Boorstin
 
It was a string...I used the Or statement and it worked. Thank you all! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top