By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,561 Members | 3,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,561 IT Pros & Developers. It's quick & easy.

Trying to write a query matching wildcards of two collumns

P: 1
I am trying to find matches between two collumns in different tables. Table A has a collumn called "description" which is a text field containing all or part of an customers name along with alot of extra information for example "acme 1232 rob 12/31/89". I want to match this to a collumn on table B called "name" which could also have the name in verious forms such as "rob", "robbie" or "robert".

I tried using 'Like "*"&[name]&"*"' as a parameter for description but it didn't work.
Feb 13 '07 #1
Share this Question
Share on Google+
4 Replies


Rabbit
Expert Mod 10K+
P: 12,366
Have you tried Like "*" & tbl2.[Name] & "*"
Feb 13 '07 #2

100+
P: 176
I am trying to find matches between two collumns in different tables. Table A has a collumn called "description" which is a text field containing all or part of an customers name along with alot of extra information for example "acme 1232 rob 12/31/89". I want to match this to a collumn on table B called "name" which could also have the name in verious forms such as "rob", "robbie" or "robert".

I tried using 'Like "*"&[name]&"*"' as a parameter for description but it didn't work.
You can use this as a field in a query:
Match?: IIf(InStr([name1],[name2])=0,"No","Yes")
Feb 13 '07 #3

100+
P: 176
Just to add:
this is usable if name1 is the long name with other stuff in it and name2 is the short name, but it works only if name2 is the string to compare name1 with, for ex:
case1 - this will work: acme 1232 rob 12/31/89, rob
case- 2 this won't work: acme 1232 rob 12/31/89, robbie

Maybe there are some algoritms out there that could find a possible match in case2, but if you want a code for the case2 to work with a simple algoritm you'll need to specify which name -part of the string with letters - acme or rob is the string to compare with the other name.
Feb 13 '07 #4

NeoPa
Expert Mod 15k+
P: 31,494
I am trying to find matches between two collumns in different tables. Table A has a collumn called "description" which is a text field containing all or part of an customers name along with alot of extra information for example "acme 1232 rob 12/31/89". I want to match this to a collumn on table B called "name" which could also have the name in verious forms such as "rob", "robbie" or "robert".

I tried using 'Like "*"&[name]&"*"' as a parameter for description but it didn't work.
Would the [Name] field contain any one of the versions or would it contain all of them?
Otherwise, what would you actually want us to help you look for?
Feb 14 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.