Thread: Wildcards
View Single Post
  #2  
Old December 8th, 2009, 05:05 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Wildcards

Emma Hope wrote:
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 we
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.

--
Marsh
MVP [MS Access]