A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Wildcards



 
 
Thread Tools Display Modes
  #1  
Old December 8th, 2009, 05:31 PM posted to microsoft.public.access.queries
Emma Hope
external usenet poster
 
Posts: 48
Default Wildcards

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?


  #2  
Old December 8th, 2009, 06: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]
  #3  
Old December 8th, 2009, 06:27 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Wildcards

Try this --
Like "*denied*access*"

--
Build a little, test a little.


"Emma Hope" wrote:

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?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.