AccessQween
Technical User
I am desperately trying to calculate total labor for employees in one table based on their rate of pay during the time period worked. I have a table that has the date of trip, and number of hours. I have another table that has the employee pay history which is the rate date and the new rate of pay. Both of these tables are joined using the employID field. If an employee received three pay raises in a year how can make sure that rate of pay for each trip matches based on their rate of pay at that time? Please reply to: thread181-1474933
I have three tables
tbl_Employee
EmployID
Name
Address
tbl_DailyTracking
TripDate
EmployID
Hours
RouteNo
tbl_EmployeePayHistory
EmployID
RateStartDate
RateEndDate
NewRate
Relationships
The Employee table has a one to many relation with the Daily Tracking table and the Employee Pay History Table.
I tried to use the following if statement but I get multiple results for each record. I can't figure how to calculate the Total Labor using the appropiate pay rate for the paticular trip date.
Total Labor: (IIf(IsNull([Employee Rates].RateEndDate),[DAILY TRACKING].Stipend*[Employee Rates].NewRate,IIf([DAILY TRACKING].tripDate>=[Employee Rates].RateStartDate And [DAILY TRACKING].tripDate<=[Employee Rates].RateEndDate,[DAILY TRACKING].Stipend*[Employee Rates].NewRate)))
What am I missing or doing wrong.
I have three tables
tbl_Employee
EmployID
Name
Address
tbl_DailyTracking
TripDate
EmployID
Hours
RouteNo
tbl_EmployeePayHistory
EmployID
RateStartDate
RateEndDate
NewRate
Relationships
The Employee table has a one to many relation with the Daily Tracking table and the Employee Pay History Table.
I tried to use the following if statement but I get multiple results for each record. I can't figure how to calculate the Total Labor using the appropiate pay rate for the paticular trip date.
Total Labor: (IIf(IsNull([Employee Rates].RateEndDate),[DAILY TRACKING].Stipend*[Employee Rates].NewRate,IIf([DAILY TRACKING].tripDate>=[Employee Rates].RateStartDate And [DAILY TRACKING].tripDate<=[Employee Rates].RateEndDate,[DAILY TRACKING].Stipend*[Employee Rates].NewRate)))
What am I missing or doing wrong.