SQL Language Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Wondering if someone could assist an Access beginner. I have two tables with
a one to many relationship. I am trying to set up a SQL Query that selects
only one record from the many table but usually get multiple records from
table two
for each record in Table one. Any assistance would be appreciated. Tables
set up as below

Master Table
EmployeeNumber (Primary Key)
EmployeeName
EmployeeDateOf Hire
EmployeeSeniorityNumber

Second Table
EmployeeNumber
JobIDNumber (Primary Key)
JobPostNumber
JobEffectiveDate
JobCompleteDate
JobDetail

Thanks
 
Wondering if someone could assist an Access beginner. I have two tables with
a one to many relationship. I am trying to set up a SQL Query that selects
only one record from the many table but usually get multiple records from
table two
for each record in Table one. Any assistance would be appreciated. Tables
set up as below

Master Table
EmployeeNumber (Primary Key)
EmployeeName
EmployeeDateOf Hire
EmployeeSeniorityNumber

Second Table
EmployeeNumber
JobIDNumber (Primary Key)
JobPostNumber
JobEffectiveDate
JobCompleteDate
JobDetail

Thanks

If a particular Employee has six records in the second table, which
record do you want to see? Naturally if you just create a Query
joining the two tables, Access will show you all of the matches. If
you want to restrict the result to just show one, you need some way to
determine WHICH one.

What criteria did you have in mind?

John W. Vinson[MVP]
 
Hi.
You have to change the join properties. In the design view of your query
(not SQL view), right click on the join where your tables are displayed.
Click join properties and select the join in which it shows all records from
table1 and only those records on table2 that match. THat should do it.

-Rob
 
Back
Top