Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Moderators
Posted

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

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...