Query help

  • 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!!!

  • OK. What if employee's shift starts around 11PM and goes all the way till next morning. How would that change the query?

  • That query willl not handle that scenario. We can work it out anyways. Do u have any "Shift identifier"??

  • Try this query

    select employeeid, employeelogindatetime, employeedept

    from tablename

    where employeelogindatetime between @fromdate and @todate

    and employeelogouttime like isnull('',null)

  • No, we don't have shift identifier.

  • 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