Solved

Non-Exact match Lookup Table

Posted on 2008-10-13
4
282 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

948 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now