JOIN using LIKE

O

Olivier Matrot

Hello I'm trying to create a query with A JOIN clause that is using LIKE.

The problem :
In table A I have international phoned numbers like this :

Col1
0010497234401
0014015392598
.......

In Table B I have Country international prefix like

Col1 Col2
Canada 001%
USA 001%
Bahamas 001242%
.......

Unfortunately the following query return no row :

SELECT A.Col1, B.Col1
FROM A INNER JOIN B ON A.Col1 LIKE B.Col2

Sure there's something wrong but I can't figure out what it is.
TIA.
 
R

Rick Brandt

Olivier said:
Hello I'm trying to create a query with A JOIN clause that is using
LIKE.

The problem :
In table A I have international phoned numbers like this :

Col1
0010497234401
0014015392598
......

In Table B I have Country international prefix like

Col1 Col2
Canada 001%
USA 001%
Bahamas 001242%
......

Unfortunately the following query return no row :

SELECT A.Col1, B.Col1
FROM A INNER JOIN B ON A.Col1 LIKE B.Col2

Sure there's something wrong but I can't figure out what it is.
TIA.

In a normal Access query the wildcard is *, not %.
 

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