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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

From old style to new inner join 1

Status
Not open for further replies.

dobe1

Technical User
Jun 28, 2004
65
US
I am trying to convert the implicit join below in Access 2000:

SELECT a.vendor_name, b.first_name + " " + b.last_name AS name, c.number, d.type
FROM vendor AS a, employees AS b, empl_phone AS c, phone_types AS d
WHERE a.vendor_id=b.vendor_id And b.ven_empl_id=c.ven_empl_id And c.type_id=d.type_id;

To an explicit such as:

SELECT a.vendor_name, b.first_name + " " + b.last_name AS name, c.number, d.type
FROM vendor AS a
inner join employees AS b on a.vendor_id=b.vendor_id
inner join empl_phone AS c on b.ven_empl_id=c.ven_empl_id
inner join phone_types AS d on c.type_id=d.type_id;


But the error I receive is:
"Syntax error (missing operator) in query expression
a.vendor_id=b.vendor_id
inner join empl_phone AS c on b.ven_empl_id=c.ven_empl_id
inner join phone_types AS d on c.type_id=d.type_id"

I have two questions:
1. The first query will not return a "name" value unless
there is a first and last name. I do not know why.

2. What am I doing incorrectly on the last query?

Any help in these matter is appreciated.

Dobe
 
SELECT a.vendor_name, b.first_name & ' ' & b.last_name AS name, c.number, d.type
FROM ((vendor AS a
inner join employees AS b on a.vendor_id=b.vendor_id)
inner join empl_phone AS c on b.ven_empl_id=c.ven_empl_id)
inner join phone_types AS d on c.type_id=d.type_id;


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top