Solved

Non-Exact match Lookup Table

Posted on 2008-10-13
4
303 Views
Last Modified: 2013-11-27
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.
0
Comment
Question by:LERNWebmaster
  • 2
  • 2
4 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22708218
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
 

Author Comment

by:LERNWebmaster
ID: 22708232
and how would I link those?
0
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 250 total points
ID: 22708242

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

Open in new window

0
 

Author Closing Comment

by:LERNWebmaster
ID: 31505760
Thanks.  I'm going to go smack myself for being so lame now. :-)
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question