Hello all,
I'm struggling to convert an SQL statement to DSum.
The table setup is as follows:
DaySheets (Table 1) which contain multiple Shifts (Table 2) which are worked by various Employees (Table 3).
The SQL statement in question is:
I have tried the following in DSum:
The result is #Error
The DSum is being used in a textbox on a continuous form of the employees, showing the total number of hours worked for each employee.
Any help would be greatly appreciated on what I need to do to fix the problem, or change the approach.
I'm struggling to convert an SQL statement to DSum.
The table setup is as follows:
DaySheets (Table 1) which contain multiple Shifts (Table 2) which are worked by various Employees (Table 3).
The SQL statement in question is:
Code:
SELECT DaySheets.DSdate, Sum(Shifts.ShiftDuration)*24 AS SumOfShiftDuration, Employees.CompanyID
FROM Employees INNER JOIN (DaySheets INNER JOIN Shifts ON DaySheets.DSPage = Shifts.DSPage)
ON (Employees.CompanyID = Shifts.Loader) OR (Employees.CompanyID = Shifts.Driver)
GROUP BY DaySheets.DSdate, Employees.CompanyID
I have tried the following in DSum:
Code:
=Dsum("[ShiftDuration]","Employees","INNER JOIN (DaySheets INNER JOIN Shifts
ON DaySheets.DSPage = Shifts.DSPage) ON (Employees.CompanyID = Shifts.Loader)
OR (Employees.CompanyID = Shifts.Driver)")
The result is #Error
The DSum is being used in a textbox on a continuous form of the employees, showing the total number of hours worked for each employee.
Any help would be greatly appreciated on what I need to do to fix the problem, or change the approach.