March 14, 2012 at 9:51 pm
Ran the first one and got the result I was expecting. Since, you mentioned 2nd one was effecient, I will use the second one. Thanks again!!!
March 15, 2012 at 7:59 pm
OK. What if employee's shift starts around 11PM and goes all the way till next morning. How would that change the query?
March 15, 2012 at 10:24 pm
That query willl not handle that scenario. We can work it out anyways. Do u have any "Shift identifier"??
March 16, 2012 at 12:14 am
Try this query
select employeeid, employeelogindatetime, employeedept
from tablename
where employeelogindatetime between @fromdate and @todate
and employeelogouttime like isnull('',null)
March 16, 2012 at 7:48 am
No, we don't have shift identifier.
March 16, 2012 at 10:08 am
Few questions
1. Can am emplolyee do the same task twice in a single day?
2. Do u have the list of tasks in another table?
3. Will the list of tasks be updated by the employee?
4. What is the first task that the employee does when he starts the shift?
5. Is there a "Log In" row for each shift?
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply