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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|