Linking two tables

D

DMT

I am trying to link two tables based on a customer number. Table 1 has just
one customer number in the field. Table 2, of which I can't change the
format because it is used for other reasons, has multiple customer numbers in
the field separated by |. So, for example, it lists the customer numbers
like |204567|605407|125741|

How can I create a query to give me results when the customer number in
table 1 matches any of the customer numbers in table 2.

Thanks for your help.
 
C

Clifford Bass

Hi,

Try this (untested):

select Table1.CustomerNumber, Table2.CustomerNumbers
from Table1, Table2
where Table2.CustomerNumbers like "*|" & Table1.CustomerNumber & "|*"

Clifford Bass
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top