Query Not = question

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

just realized my query isn't working properly and i'm stumped

Have a text field [RPlan] in a table
QRY1 contains [RPlan]
I want to find all records in QRY1 that do not contain "XXX" in [Rplan]

not="XXX" doesn't work
null works but doesn't ensure only XXX is the only records excluded

What is the proper way to exclude only records containing XXX when querying
QRY1 in a second query??
 
Thanks
Gary Walter said:
Hi Junior,

WHERE NZ(([RPlan]<>'XXX'),-1)

just realized my query isn't working properly and i'm stumped

Have a text field [RPlan] in a table
QRY1 contains [RPlan]
I want to find all records in QRY1 that do not contain "XXX" in [Rplan]

not="XXX" doesn't work
null works but doesn't ensure only XXX is the only records excluded

What is the proper way to exclude only records containing XXX when querying
QRY1 in a second query??
 
Just to be sure,
WHERE returns record
when condition = -1 (True)

[RPlan] NZ(([RPlan]<>'XXX'),-1)
'XXX' 0 (False)
<>'XXX' -1 (True)
Null -1 (True)

or

[RPlan] NZ(([RPlan]<>'XXX'),0)
'XXX' 0 (False)
<>'XXX' -1 (True)
Null 0 (False)
 

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