What exactly are you trying to achieve? To have a list of all Jobs but show the first name instead of the ID?
What are you running this query on? SQL or within the Visual Studio designer?
I don't think you need to do anything on the query. Personally I have a table where it records
"Account Manager"
"Project Leader"
I then have another table called Employees that list names. EmployeeID, EmployeeName, EmployeeType - this is an integer column; 1 = account manager, 2 = project leader, 3 = another role
In my main table, it just records the Employee ID.
In my app, on the DataTable is where I create my queries.
I have queries such as
- SELECT * FROM Projects WHERE Employee.EmployeeTypeID = 1 ("Account Manager")
- SEELCT * FROM Projects WHERE Employee.EmployeeTypeID = 2 ("Project Manager")
You would simply do the same. In your app you would have combo boxes that display the name instead of the ID (you would need to create 2 dataTables - Staff1 and Staff2, both connecting to the Staff table)
You would then have queries such as:
- SELECT * FROM Jobs
- SELECT * FROM Jobs WHERE Jobs.Staff1 = @Staff1ID (parameter query, you would then use your app to select a member of staff from a list, and all jobs would return for that staff member if the ID is in Jobs.Staff1)
- SELECT * FROM Jobs WHERE (Jobs.Staff1 = @StaffID) OR (Jobs.Staff2 = @StaffID) | This parameter query will return all jobs where selected staff member's ID is in either jobs.staff1 field or jobs.staff2
etc etc...
I don't know if I've got the wrong end of the stick, but not sure what exactly you want to achieve with this query within your application.