Wildcards

E

Emma Hope

Hi all,

I have a query where i want to pick all the records with 'denied access' in
them, the records could be as follows;

denied access
denied me access
customer denied access
denied access by customer
customer denied access to me

when i use

like "*denied*" and like *access*" it only returns the last record.....

Do i really have to do:

like "denied*" and like "*access*"
like "denied*" and like "*access"
like "*denied*" and like "*access"

etc etc etc?

There must be an easier way?
 
M

Marshall Barton

Emma said:
I have a query where i want to pick all the records with 'denied access' in
them, the records could be as follows;

denied access
denied me access
customer denied access
denied access by customer
customer denied access to me

when i use

like "*denied*" and like *access*" it only returns the last record.....

Do i really have to do:

like "denied*" and like "*access*"
like "denied*" and like "*access"
like "*denied*" and like "*access"

No, you do not need to do that.

When posting a question about queries, it really helps us
when you post a Copy/Paste of your query's SQL view so we
can see what you really have without any typos being
introduced by retyping it.

You said you used:
like "*denied*" and like *access*"
but there is a missing quote after the second Like. Since
Access should complain about such an obvious syntax error, I
guess that's really a typo. OTOH, since that is not a saved
query's SQL view, I can not be sure of much of anything. If
your query's SQL view WHERE clause were:
WHERE [somefield] Like "*denied*"
And [somefield] Like "*access*"
I would expect it to match all the records in your example
as well as records that contain stuff like:
"xxx access yyy denied zzz"
"xxx denied yyy access zzz"
"xxx Access yyy Denied zzz"
where xxx, yyy and zzz can be any string of characters
including nothing.
 

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

Top