Now when I query this information and use the SUM() function to get the total for all hours when absent and hours for overtime, the result is 28.5 and 10.5.
28.5 represents the total number of hours absent from work and 3.5 (and 10.5 apparently) represent the total hours of overtime. Now why would the total for absence be correct and the total for overtime have 7 hours of non existent overtime?
Here's my query :
Expand|Select|Wrap|Line Numbers
- SELECT SUM(Emp_Absence.emp_Absence_work_hours) AS Total_Absense, SUM(Emp_Overtime.emp_overtime_hours) AS Total_Overtime
- FROM ((Employee INNER JOIN Emp_Absence ON Employee.emp_num = Emp_Absence.emp_num) INNER JOIN Emp_Overtime ON Employee.emp_num = Emp_Overtime.emp_num)
- WHERE (Employee.emp_fname = 'Timothy') AND (Emp_Overtime.emp_overtime_date LIKE '%October%2014') AND (Emp_Absence.Emp_Absence_date LIKE '%October%2014')
Help and suggestions will be greatly appreciated.