Need Help with SQL query...

  • Thread starter Thread starter chusem
  • Start date Start date
C

chusem

Guest
Hi, Folks!

I'm in desperate need of some help finishing/writing a query.
This one is to find the total amount of time spent "on task" versus the total amount of "down time" an employee has during his/her working day. This is the SQL I have so far, but it doesn't seem to be quite right:

SELECT Documents.DateIn, [Calculate Operator Total Time spent on Job].[Total Time], [Enter Total Hours Worked] AS [Hours Worked]
FROM Employees, Documents INNER JOIN [Calculate Operator Total Time spent on Job] ON Documents.ID = [Calculate Operator Total Time spent on Job].ID
WHERE (((Documents.DateIn)=[Enter Date]) AND ((Employees.Employee)=[Employee Name?]));

I need to add up the total Time spent on all jobs for a given date for a given employee, then divide that by the number of hours the employee worked. I would like to specify as parameters: Date, Employee Name, Hours Worked (we have really bizarre working hours here.. some people work 7 hour days, others work 12 hours, etc.), and have the query display Date, Employee Name, Hours Worked, Time On Task and "down" time (total time working - hours worked for the day). Note that "Hours Worked" is not a field in any table (at this time, but I'm open to suggestion!). Any suggestions??

Thanks!
 
I think that the information of the query is not sufficient to be able to get a clear picture of your table structure. Maybe You explain to us how the involved tables stand together in relation.
 

Users who are viewing this thread

Back
Top Bottom