query help (1 Viewer)

nelslynn

Registered User.
Local time
Today, 17:49
Joined
Oct 8, 2001
Messages
40
I need a query that will provide the names of two employees from the employee Table where the employee ID's are in another table. I am doing this in code, so the query cannot query another query.

EmployeeTable: empID, empFName, empLName
TeamTable: empID1, empID2

Thanks
 

namliam

The Mailman - AWF VIP
Local time
Today, 18:49
Joined
Aug 11, 2003
Messages
11,695
Code:
strSQL = "select * " & _ 
"from "  & _ 
"(teamTable left join "& _ 
"EmployeeTable as Emp1 on empID1 = Emp1.EmpID) Left Join "& _ 
"EmployeeTable as Emp2 on empID2 = Emp2.EmpID "

That should do the trick...

Regards

The Mailman
 

nelslynn

Registered User.
Local time
Today, 17:49
Joined
Oct 8, 2001
Messages
40
Thanks, but I get a error message "Join is not supported".
I'm using VB.NET
 

namliam

The Mailman - AWF VIP
Local time
Today, 18:49
Joined
Aug 11, 2003
Messages
11,695
It is Access SQL, am unsure as to the syntax in VB.net ...

The query in itself is correct...

Sorry for not beeing any further help...

Regards
 

Users who are viewing this thread

Top Bottom