Join on first 10 characters

S

Steve W

I have a query that needs to join one table field containing 10 characters
and one containing 11. I want to join based on the first 10 characters. How
can I do this?

TIA,
 
K

Ken Snell [MVP]

Use what's called a non-equi join (must be entered in SQL view for the
query, as it cannot be represented in the QBE view):

SELECT TableOne.*, TableTwo.*
FROM TableOne INNER JOIN
TableTwo ON
Left(TableOne.FieldNameA, 10) =
TableTwo.FieldNameB;
 
Top