chrisaroundtown
Technical User
Hi,
I have a table called 'Employ Status Change' and another called 'Schedule'.
The table called 'Employ Status Change' shows when employment statuses have been changed. It has an employee ID, the employment status (Permanent, Casual etc) and the effective date.
The table called 'Schedule' has the employee ID, the date of the schedule, the start time of the shift and the end time of the shift.
I need a query to show the 'schedule' table with the employment status appropriate for that date.
For example, let's say employee number 88 was a Permanent employee until 1st Dec 2004 when they became a Casual employee. The query needs to return a Permanent status for all schedules prior to 1st Dec 2004 and a Casual status on and after 1st Dec 2004.
Also, as employees can change their employment statuses multiple times there is the need to look for the entry in the 'Employment Status Change' table that has an effective date closest to the schedule date without going over.
I envisage it working simliar to a DLookup where it find the employment status from the 'Employment Status Change' table that has the effective date closest to the schedule date without going over.
Please let me know if you can provide any help or if you need more information.
Thanks
Chris
I have a table called 'Employ Status Change' and another called 'Schedule'.
The table called 'Employ Status Change' shows when employment statuses have been changed. It has an employee ID, the employment status (Permanent, Casual etc) and the effective date.
The table called 'Schedule' has the employee ID, the date of the schedule, the start time of the shift and the end time of the shift.
I need a query to show the 'schedule' table with the employment status appropriate for that date.
For example, let's say employee number 88 was a Permanent employee until 1st Dec 2004 when they became a Casual employee. The query needs to return a Permanent status for all schedules prior to 1st Dec 2004 and a Casual status on and after 1st Dec 2004.
Also, as employees can change their employment statuses multiple times there is the need to look for the entry in the 'Employment Status Change' table that has an effective date closest to the schedule date without going over.
I envisage it working simliar to a DLookup where it find the employment status from the 'Employment Status Change' table that has the effective date closest to the schedule date without going over.
Please let me know if you can provide any help or if you need more information.
Thanks
Chris