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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a query to showing data from two different tables

Status
Not open for further replies.

shipwreck

Technical User
Jun 7, 2001
3
0
0
US
I have a problem: How can I use a query to show data from to different tables. My users want to see what personnel are coming into taking there place. One table is the onhand table. It only shows those records of perosnnel currently onhand!!! The other table is the inbound table. It's a listing of propsective gains incoming. Once I have them inputted, I would sort by BSC to matchup personnel up.

Table 1: onhand Table 2: Inbound
[Full name] [Full name]
[SSN] [SSN]
[BSC] [BSC]
[current pos] [current pos]
[skill level] [skill level]
[phone number] Not avail
[YRS on job] Not avail
Job pos.
DOB

I need to show full names, SSN, BSC, and skill levels from both tables. Remember the tables are links by SSN but inbound personnel are not in the onhand table.
 
I assume you meant that the rows can be matched by BSC rather than SSN as no two people should have the same SSN.

Select a.BSC,
a.FullName As CurrPerson, a.SSN As CurrSSN,
a.SkillLevel As CurrSkillLvl,
b.FullName As NewPerson, b.SSN As NewSSN,
b.SkillLevel As NewSkillLvl
From Onhand a Join Inbound b
On a.BSC=b.BSC

I only select BSC once as that should be the same on both tables. Terry

The reason why worry kills more people than work is that more people worry than work. - Robert Frost
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top