Join property expression

Therat

Access Denied
Local time
Today, 05:09
Joined
May 21, 2002
Messages
53
Is it possible to create an SQL expression that joins the two tables together based on the right five characters in one table and the full field in the other table? I realize I could accomplish this by adding a query to the process, but I don't want to create another query. Is it possible?

ex.

SELECT fk1.[feeder key], fk2.[feeder], fk2.[mod]
FROM fk1 LEFT JOIN fk2 ON fk1.right([feeder key],5) = fk2.feeder;

Thanks in advance!
 
Apparently yes...

With a slight amendment to your Sql statement. Won't show in Query builder though

Code:
SELECT fk1.[feeder key], fk2.[feeder], fk2.[mod]
FROM fk1 LEFT JOIN fk2 ON right(fk1.[feeder key],5) = fk2.feeder;
(I used left as a test - but seems to work)


Vince
PS: I didn't know this would work but it does and relieves the use of a sub query.
 

Users who are viewing this thread

Back
Top Bottom