Stuck on a Record with multiple IDs

A

Adam

Hey,

I have a Table called [Data] with 3 Id’s fields that track changes made by
the users.

[Data].[LoginAdmin]
[Data].[LoginCallback]
[Data].[LoginRecruiter]

I have a 2nd table named employees. This has the employee ID and the
employee names in it.

I can not get [employee].[emp_id] to link with the all three fields to
create one query.

I ended up breaking them up into three separate queries and label a column
with Admin, Callback or Recruiter.

But now I can not get them to go back into on query.

Any suggestions
Adam
 
K

KARL DEWEY

Well your data table is laid out as a spreadsheet. It needs to look like
this --
LoginType - Text - Admin, Callback, Recruiter
EmpID -
ActionDate - DateTime

But this should do you --
SELECT Data.LoginAdmin, Data.LoginCallback, Data.LoginRecruiter,
Employee.EmployeeID AS Admin, Employee_1.EmployeeID AS Callback,
Employee_2.EmployeeID AS Recruiter
FROM ((Data LEFT JOIN Employee ON Data.LoginAdmin= Employee.EmployeeID) LEFT
JOIN Employee AS Employee_1 ON Data.LoginCallback = Employee_1.EmployeeID)
LEFT JOIN Employee AS Employee_2 ON Data.LoginRecruiter =
Employee_2.EmployeeID;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top