L
Linda
I've created a simple query to get the number of hours a
person worked between two dates. For each employee, it
returns the name of each project the employee worked on
between the dates the user enters.
SELECT DISTINCTROW EMPLOYEES.Name, Sum(TimeWorked.Hours)
AS [Sum Of HOURS]
FROM EMPLOYEES INNER JOIN (Categories INNER JOIN (PROJECTS
INNER JOIN TimeWorked ON PROJECTS.ProjectID =
TimeWorked.ProjectID) ON Categories.CategoryID =
PROJECTS.CategoryID) ON EMPLOYEES.EmployeeID =
TimeWorked.EmployeeID
WHERE (((TimeWorked.Date) Between [Beginning Date] And
[End Date]))
GROUP BY EMPLOYEES.Name;
The problem? This works for some dates, and not for
others. If I enter the [Beginning Date] 10/23/2003 and
the [End Date] 10/24/2003, I get only hours worked on
10/23/2003, except for one employee, for whom I get the
10/24 hours reported for 1 of 4 projects she worked on
that day. However, if my [Beginning Date] is 10/24/2003
and my [End Date] is 10/25/2003, I get an accurate report.
I've played around with various dates and can't figure out
a patter. Ideas? thanks.
person worked between two dates. For each employee, it
returns the name of each project the employee worked on
between the dates the user enters.
SELECT DISTINCTROW EMPLOYEES.Name, Sum(TimeWorked.Hours)
AS [Sum Of HOURS]
FROM EMPLOYEES INNER JOIN (Categories INNER JOIN (PROJECTS
INNER JOIN TimeWorked ON PROJECTS.ProjectID =
TimeWorked.ProjectID) ON Categories.CategoryID =
PROJECTS.CategoryID) ON EMPLOYEES.EmployeeID =
TimeWorked.EmployeeID
WHERE (((TimeWorked.Date) Between [Beginning Date] And
[End Date]))
GROUP BY EMPLOYEES.Name;
The problem? This works for some dates, and not for
others. If I enter the [Beginning Date] 10/23/2003 and
the [End Date] 10/24/2003, I get only hours worked on
10/23/2003, except for one employee, for whom I get the
10/24 hours reported for 1 of 4 projects she worked on
that day. However, if my [Beginning Date] is 10/24/2003
and my [End Date] is 10/25/2003, I get an accurate report.
I've played around with various dates and can't figure out
a patter. Ideas? thanks.