I need help to come up with a logic to filter this out.
Scenario
I need to sum up the login-logout's total number of hours per agents.
On a regular case with multiple login-logout, the formula will be the first login vs the last logout based on the login date.
Twist
Now the problem is on night shifts,
for example an agent has a schedule of 10pm to 6am.
In his session, he logged in at 10pm(day 1), but somewhere along his session time he got disconnected at 2am(day 2) in the morning.
So he will login again (2am) and logout at 6am.
If I would be making reports on the login-logout of the agents who logged in on day 1,
the said agent will only have four(4) hours (10pm-2am).
And with the report to be generated the other day he will have a login time of 2am(the continuation of the previous log) up to 6am(time end of the second day at work). Which will only make four(4) hours of working time.
I hope im explaining myself clearly here, so my question is how will I be able to determine that the "n'th" time of his login-logout is still part of the previous login-logout?
Scenario
I need to sum up the login-logout's total number of hours per agents.
On a regular case with multiple login-logout, the formula will be the first login vs the last logout based on the login date.
Twist
Now the problem is on night shifts,
for example an agent has a schedule of 10pm to 6am.
In his session, he logged in at 10pm(day 1), but somewhere along his session time he got disconnected at 2am(day 2) in the morning.
So he will login again (2am) and logout at 6am.
If I would be making reports on the login-logout of the agents who logged in on day 1,
the said agent will only have four(4) hours (10pm-2am).
And with the report to be generated the other day he will have a login time of 2am(the continuation of the previous log) up to 6am(time end of the second day at work). Which will only make four(4) hours of working time.
I hope im explaining myself clearly here, so my question is how will I be able to determine that the "n'th" time of his login-logout is still part of the previous login-logout?