Diesel Posted June 9, 2005 Posted June 9, 2005 Employee ------------ id int, firstname varchar(30), lastname varchar(30), Time Table ----------- employeeid int, timein datetime, timeOut datetime Need to Sum total hours given employeeid and date range. Quote
Moderators Robby Posted June 11, 2005 Moderators Posted June 11, 2005 You can do something like this... SELECT E.EmployeeID, Sum(DateDiff("hh",T.TimeIn,T.TimeOut)) AS Hours FROM Employee E INNER JOIN TimeTable T ON E.EmployeeID = T.EmployeeID WHERE T.SomeDateColumn Between '1/1/1990' And '1/1/2005' GROUP BY E.EmployeeID Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.