Hi Somerston and welcome to DaniWeb
You will need to join to the employee table twice to get the name for each column. Something like this should work:
-- first select the columns required
SELECT wo.id, em.name as submitted_by, emp.name as completed_by
-- not sure if you can use these aliases
-- because they are also column names of the WorkOrders table
-- if not, rename them to submitted_name and completed_name for example
-- from tables
FROM WorkOrders wo
INNER JOIN employee em
-- link submitted_by to id of employee
ON wo.submitted_by = em.id
INNER JOIN employee emp
-- link completed_by to id of employee
ON wo.completed_by = emp.id
Last edited by darkagn; Apr 14th, 2009 at 10:26 am. Reason: welcome!
Reputation Points: 395
Solved Threads: 192
Veteran Poster
Offline 1,136 posts
since Aug 2007