Hello all,
I'm struggling to get an SQL statement that works. Most of my (very limited) SQL knowledge comes from using query design and then switching to SQL view. That has got me through most things, but this current table design is stumping me.
I've attached a simplified copy of the table relationships.
What I would like to achieve is as follows:
A continuous form showing all the employees. Each row will show a total of the hours worked by that employee within the last 28 days (as either Loader or Driver). I'm doing this by setting the control source of a textbox to a function which returns the value of a SQL statement.
The bit I am struggling with is getting the SQL syntax to work. I have tried countless variations on the syntax, but I either get ambiguous outer join error messages, or the SQL runs but generates incomplete results.
If anybody could offer any pointers on what the SQL statement should look like (with any related queries required to overcome any ambiguous outer join issues) that would be fantastic.
I'm struggling to get an SQL statement that works. Most of my (very limited) SQL knowledge comes from using query design and then switching to SQL view. That has got me through most things, but this current table design is stumping me.
I've attached a simplified copy of the table relationships.
What I would like to achieve is as follows:
A continuous form showing all the employees. Each row will show a total of the hours worked by that employee within the last 28 days (as either Loader or Driver). I'm doing this by setting the control source of a textbox to a function which returns the value of a SQL statement.
The bit I am struggling with is getting the SQL syntax to work. I have tried countless variations on the syntax, but I either get ambiguous outer join error messages, or the SQL runs but generates incomplete results.
If anybody could offer any pointers on what the SQL statement should look like (with any related queries required to overcome any ambiguous outer join issues) that would be fantastic.