|
Posted by Plamen Ratchev on 11/18/07 04:16
Hi Richard,
You simply add one more join for the Employees table to get the names for
the other ID, something like this:
SELECT A.EmployeeID,
E.FirstName AS emp_fname,
E.LastName AS emp_lname,
A.CreatedByID,
C.FirstName AS creator_fname,
C.LastName AS creator_lname,
A.Date1,
A.Date2,
A.Content
FROM EmployeeApplication AS A
JOIN Employees AS E
ON A.EmployeeID = E.EmployeeID
JOIN Employees AS C
ON A.CreatedByID = C.EmployeeID
This is assuming the CreatedByID column is referring to the EmployeeID
column from the Employees table. If that is not the case then you have to
replace the Employees table in the second join with the appropriate table
and the appropriate column for the join.
HTH,
Plamen Ratchev
http://www.SQLStudio.com
Navigation:
[Reply to this message]
|