Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple JOIN Query

Status
Not open for further replies.
Joined
Dec 5, 2001
Messages
44
Location
US

I have tried this in many different ways (Thanks to the responses I got from this board)but I keep hitting dead ends. Here is what I want now......

I got three tables: Application, ApplicationDetails and Employees

Application Table has ApplicationID & EmployeeID as a composite primary key.

ApplicationID
-------------
EmployeeID
------------


ApplicationDetails Table has ApplicationID as primary key.

ApplicationID
-------------
SubmissionDate
ApplicantNo


An Application can have many employees and one employee can be in many applications.

Employee Table has EmployeeID as PK and contains details like name etc.

EmployeeID
----------
FirstName
LastName


Now I want to create a form that contains:

ApplicationID, EmployeeID AND Names of ALL the employees associated with that ApplicationID. No of employees associated with an Applicaiton can vary from one to many.


ApplicationID

EmployeeID1 FirstName1
EmployeeID2 FirstName2
-
-
-

I am working with SQL Server Back End

Thanks Again!










 
I guess a sql statement to return the records you want might look something like this:


'Select FirstName, LastName, etc... from tblEmployee As Emp
Join tblApplication As App
On Emp.EmployeeId = App.EmployeeId
Where App.ApplicationId = <Whatever the appid you want>'


Not sure this is what you were looking for but hope it helps never the less.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top