Non-Exact match Lookup Table

I want to update table1.Code with table2.Code by matching the value of table1.Description to the data in table2.MatchingText where the two are not exact matches (eg. table1.Description LIKE table2.MatchingText), essentially a non-exact match lookup table.

Tables are structured as:

table1
-------
recNum
Description
Code

table2
-------
MatchingText
Code

It seems like it should be easy, but I'm at a loss.
LERNWebmasterAsked:
Who is Participating?
 
Kevin CrossChief Technology OfficerCommented:

UPDATE Table1 t1 INNER JOIN Table2 t2
ON t1.Description LIKE "*" & t2.MatchingText & "*"
SET t1.Code = t2.Code

Open in new window

0
 
Kevin CrossChief Technology OfficerCommented:
You are pretty close, but since you don't have an exact match you have to do something like this:

table1.Description LIKE "*" & table2.MatchingText & "*"
0
 
LERNWebmasterAuthor Commented:
and how would I link those?
0
 
LERNWebmasterAuthor Commented:
Thanks.  I'm going to go smack myself for being so lame now. :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.