SELECT t1.projectid, ;
t2o.oecname AS OwnName, ;
t2e.oecname AS EngName, ;
t2c.oecname AS ConName, ;
FROM table1 t1 ;
JOIN table2 t2o ON t1.owner = t2o.oecid ;
JOIN table2 t2e ON t1.engineer = t2e.oecid ;
JOIN table2 t2c ON t1.contractor = t2c.oecid
>I have two tables as follows:
>
>Table 1 has two fields, oecid and oecname. For example,
>
>MCOR1985..... 3M Corporation
>ABBL1991..... ABB Lummus
>BLAC2130..... Black & Veatch
>
>Table 2 has a multiple number of fields of which I am concerned with the following four: projectid, owner, engineer, and contractor. The owner, engineer, and contractor fields contain an 'oecid'.
>
>I want to be able to pull out the projectids whose owner,engineer or contractor 'oecid' matches an 'oecid' form Table 1. In addition, I would like to convert the 'oecid' in each of the owner, engineer, contractor fields to the corresponding 'oecname'.
>
>I hope this makes sense! Any suggestions would be greatly appreciated.
>
>Thanks in advance for your help,
>Russell Clendenon
--sb--