MS Query, Join 2 data sources using partial match

Android8675

New Member
Joined
Jan 5, 2007
Messages
23
(Excel 2007)
I've been trying to track down the exact way to do this, and I just can't seem to get it. So stop me if I'm doing this all wrong.

I have a ODBC data source which consists of a lot of manufacturing BOMs (Bill of Materials), now a customer wants us to make a list of all their boms by part#.

Their part numbers are 6-12 alpha numeric part#'s.

We store the BOMs as the part# + Rev. in our database.

What I want to do is query the data and "join" the list that they want extracted.

What I did was load up all the BOM data onto a table, and the list of part#'s from the customer on a second table. Saved as Excel.

Opened a new Workbook and used MS Query to pull in the 2 tables from file #1.

Now if I join the list of parts to our part# + Rev field, I don't get anything. But I added some part#'s with Rev to their list and it worked.

Suggestions? I need some kind of partial match. For instance if their part# is "123456", then "123456 A" would match. I was trying editing the query's "WHERE" statement, but the syntax is eluding me.

Original, basic JOIN that MS Query wizard adds.
Code:
WHERE `'Filter List$'`.Column1 = `'BOM Query$'`.BKBM_PARENT

tried something like this:
Code:
WHERE `'Filter List$'`.Column1 Like `'BOM Query$'`.BKBM_PARENT & "*" OR  `'BOM Query$'`.BKBM_PARENT Like `'Filter List$'`.Column1 & "*"

Hope that's enough, info, but let me know if more information is needed.

Thanks in advance,
-Andy
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,214,925
Messages
6,122,298
Members
449,077
Latest member
Rkmenon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top