multiple text criteria, satisfy 1 only, etc???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table of customers. This table has their name, an address 1
field, a check payable to field, and more. To preface this question,
we got the data from other people and just have to get the answers out
of the data for the time being.

I am trying to query the following:

1) All records where the "check payable to" field does not = the
customer's name.

2) All records where the "check payable to" field does not = the
customer's name&" "& the "address 1" field

3) All records where the "check payable to" field contains "*&*"

4) All records where the "check payable to" field contains "*and/or*"

5) All records where the "check payable to" field contains "* and *"

Some things I have found. If the customers name doesnt match the check
payable, but the customer's name and their address 1 field matches, I
don't need them.

Also, number 5 is because a lot of people have "and" in their name.
(Anderson)

I would so appreciate any help. I have tried this many ways without
much of any luck!

p.s., sorry I am not good at explaining my challenge!

Thanks,
 
Hi

This is just the basics (your will need to alter tbleName to whatever you
use) but it should point you in the right direction. Have fun

SELECT tblName.CheckPayable, tblName.CustomersName, tblName.Address1
FROM tblName
WHERE (((tblName.CheckPayable)="*" & "*") AND (Not
(tblName.CustomersName)=[CheckPayable]) AND (Not
(tblName.Address1)=[CheckPayable])) OR (((tblName.CheckPayable) Like
"*and/or*")) OR (((tblName.CheckPayable) Like "*" And (tblName.CheckPayable)
Like "*"));
 

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