Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to join two fields based on partial matching info 1

Status
Not open for further replies.

jenni

Technical User
May 12, 2000
21
US
Table A has a column with a 10 digit number, Table B has the begining six of that 10 digit number...

I want to run a query based on the six digits pulling out all that are similiar in 10 digit form from Table A...can I join those fields somehow? I have no other field where I could join the tables and I want to avoid adding a new column to table A, where i copy the first 6 - just so i can match up.

Appreciate your help.

Thank you!
 
If the 'numbers' are stored as text, you could join them like this...

SELECT fldOne,fldTwo,fldThree,etc..
FROM TableA INNER JOIN TableB
ON LEFT(TableA.fldOne,6) = LEFT(TableB.fldTwo,6);



There are two ways to write error-free programs; only the third one works.
 
Thank you very much....it worked!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top