Join on first 10 characters

  • Thread starter Thread starter Steve W
  • Start date Start date
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,
 
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;
 
You are going to need to create a Query, one of whose fields is
Mid$(LongerString,1,10), from the second table and then base the join
on that calculated field.

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,


Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Back
Top