How can I have a look-up field that grabs the hourly salary for an employee as it was on the date that employee worked?
I have a WORKSHEETS table; this table has a field called Worksheet Date.
I have an EMPLOYEES table; this table has a field called current_hourly_salary.
I have a LABOR ENTRIES table which captures the employees that worked on each Work Date, how many hours they worked, and that the cost of labor was (current_hourly_salary x hours_worked). Each record in this table has a Related Worksheet (LUF: worksheet_date) and a Related Employee (LUF: current_hourly_salary).
Labor Entries } Worksheets { Employees
The employees' salary changes at least 3 - 4 times per year. I want my Labor Entries to calculate the cost of labor using the employee's salary as it was at the time he/she worked... based on the Worksheet Date; so that whenever we go back to look at at worksheet from January, the labor calculations will use the employee's salary as it was in January, not as it is now.
Note: I do not want users to have to manually enter an employee's current salary every time they make a Labor Entry. This would be too cumbersome and time consuming and would defeat the purpose altogether.
I realized that another table was needed... HOURLY SALARIES, to keep historical salary data for each employee. This table has a Related Employee, Hourly_Salary, and Effective_Date.The current_hourly_salary field in my EMPLOYEES table is now a summary field from HOURLY SALARIES that brings in the latest (or current) Hourly_Salary based on the Effective_Date.
Labor Entries } Worksheets { Employees { Hourly Salaries
But this still does not resolve the issue; while I can now keep historical salary data, I still don't know how to retain the hourly salaries for LABOR ENTRIES with earlier labor dates. As it is, my labor calculation uses the employee's current_hourly_salary as it is now because it's a look-up field which always grabs the most current hourly rate for that employee.
Any assistance you can provide will be greatly appreciated.
Juan