G
George B via AccessMonster.com
I am trying to create an active employee list.
Essential table structure is as follows:
tbEvents (a table holding all employee and applicant actions)
-pkeventid (primary key - autonumber)
-date (date of the action)
-fkeventtypeid (foreign key of the action type e.g. promotion, transfer,
flogging)
-fkpeopleid (foreign key of the employee)
tbEvents has thousands of records. To create an active employee list, I need
a query that can go through the table and select all records reflecting the
hiring of an employee. Some employees have been hired, left and been rehired.
I only want the record of their most recent hiring. Then, I need to
eliminate from that set any employees with a termination date later than
their most recent hire date.
I am having quite a bit of trouble and any advice on structuring the sql
would be greatly appreciated.
Thanks,
g
Essential table structure is as follows:
tbEvents (a table holding all employee and applicant actions)
-pkeventid (primary key - autonumber)
-date (date of the action)
-fkeventtypeid (foreign key of the action type e.g. promotion, transfer,
flogging)
-fkpeopleid (foreign key of the employee)
tbEvents has thousands of records. To create an active employee list, I need
a query that can go through the table and select all records reflecting the
hiring of an employee. Some employees have been hired, left and been rehired.
I only want the record of their most recent hiring. Then, I need to
eliminate from that set any employees with a termination date later than
their most recent hire date.
I am having quite a bit of trouble and any advice on structuring the sql
would be greatly appreciated.
Thanks,
g