Microsoft
Software
Hardware
Network
Question : SQL needs to gets info from Inner Join on two Fields
I have two fields in this query that display Employee IDs on a report but I need them to both display Employee Names instead. I can get the name to come back with an inner join for one field but I don't know how to make it come back for 2 fields.
In order to get the employee name, they need to reference tblEmployees to get the "name" of the employee instead of the ID.
SELECT tblActions.intActionID, tblActions.intIncidentID, tblActions.intAction, tblActions.intEmployeeID, tblActions.intSupervisorID
, tblActions.datActionDate, tblEmployee.txtEmployee
FROM tblActions INNER JOIN tblEmployee ON tblActions.intEmployeeID = tblEmployee.intEmployeeID;
How do I get intSupervisorID to reference tblEmployee and display the employee name?
Answer : SQL needs to gets info from Inner Join on two Fields
Sorry, didn't realize it was access. I believe parens will solve:
SELECT tblActions.intActionID, tblActions.intIncidentID, tblActions.intAction, tblActions.intEmployeeID, tblActions.intSupervisorID
, tblActions.datActionDate, E1.txtEmployee
as EmployeeName, E2.txtEmployee as SupervisorName
FROM (tblActions INNER JOIN tblEmployee E1 ON tblActions.intEmployeeID = E1.intEmployeeID )
INNER JOIN tblEmployee E2 ON tblActions.intSupervisorID
= E2.intEmployeeID
Random Solutions
Adding Columns to ASP.Net Gridview Control
Trouble programmatically getting a list of the files on FTP server in VB.NET
Website script to track each user's individual experience
How to repair a dell e171fpb monitor
This program cannot be run in DOS mode.
MaxConnections parameter in websphere plugin
calculate age in mysql
splashscreen
Compare Column Names in Tables in Schema A With Column Names in Tables in Schema B.
Setting the "All Day Event" checkbox default to checked