Problem with multiple relationships

fzamora

Software Engineer
Local time
Today, 16:55
Joined
May 28, 2004
Messages
6
I have the following problem:

I have a PurchaseRequest table with the following fields

PRNumber, RequestorId, BuyerId

I have a HR table with the following fields

EmployeeID, FName, LName

I have a Phone table with the following fields

EmployeeID, PhoneNumber

Both the RequestorId and the BuyerId are foreign keys to the primary key EmployeeID in the HR table. When I try to create a query so that I can display the relevant data for the Requestor and the Buyer (i.e. FName, LName, PhoneNumber) I get an error "Invalid operation. (Error 3219)". How can I get the values to display correctly. I have created other queries for just the HR information so that I don't have to do Right Joins in my main query. Any help with this would be greatly appreciated.
 
SELECT PRNumber, B.LName & ", " & B.FName as BuyerName,
R.LName & ", " & R.FName as RequestorName
FROM PurchaseRequest
Inner Join HR B ON BuyerID = B.EmployeeID
Inner Join HR R ON RequestorID = R.EmployeeID

You mean something like that?
 

Users who are viewing this thread

Back
Top Bottom