I need a calculation of the time spent in a room.
I have eg 2 or more entrances and so many exits to and from a room. I have an access controller at each door both at the entrance and at the exit in both directions (defined in the event_point_id field. So I have a record of each entry and exit, for example:
event_point_id = 1 is IN (door 1)
event_point_id = 2 is OUT(door 1)
event_point_id = 3 is IN (door 2)
event_point_id = 4 is OUT (door 2), etc.
I have to calculate the time spent in a room for a certain period. Signs OUT-INPUT = TIME spent. Every worker goes in and out several times during the day.
Now there are a number of things to keep in mind:
- if there is no exit and there is an entrance (then the exit is ignored and only a warning is issued that there is no exit) and in the calculation part it stands at 0 because we do not know how much he spent inside)
- if it does not have an input and has an output (similar to the first situation - in fact, if the last one was an input it cannot have the same input again afterwards)
- if it happens several times within a few seconds (then ignore those items and only calculate the first item, ie completely erase them from the calculation)
- if there is no exit for more than a couple of hours (about 15 hours) then the worker is considered to have left without checking out and counter
- if the worker reports in the morning when he arrives at work and does not check out and the next day when he arrives at work he does not report or logs off as being considered a mistake because it is impossible to spend more than 15 hours in the room, although this is practically very possible because there are magnetic locks on each door
- the calculation should be by items for the selected worker in the specified selected period
I posted the base with a message. The database is called Access, and the table where the reads are is called acc_monitor_log
I was stuck at the very beginning of calculating the time spent in the room and defining the items that go before: ENTRANCE goes before EXIT, as well as throwing out incorrect items (double entry or exit) and leaving only the correct ones. By what procedure do this?
Thanks
I have eg 2 or more entrances and so many exits to and from a room. I have an access controller at each door both at the entrance and at the exit in both directions (defined in the event_point_id field. So I have a record of each entry and exit, for example:
event_point_id = 1 is IN (door 1)
event_point_id = 2 is OUT(door 1)
event_point_id = 3 is IN (door 2)
event_point_id = 4 is OUT (door 2), etc.
I have to calculate the time spent in a room for a certain period. Signs OUT-INPUT = TIME spent. Every worker goes in and out several times during the day.
Now there are a number of things to keep in mind:
- if there is no exit and there is an entrance (then the exit is ignored and only a warning is issued that there is no exit) and in the calculation part it stands at 0 because we do not know how much he spent inside)
- if it does not have an input and has an output (similar to the first situation - in fact, if the last one was an input it cannot have the same input again afterwards)
- if it happens several times within a few seconds (then ignore those items and only calculate the first item, ie completely erase them from the calculation)
- if there is no exit for more than a couple of hours (about 15 hours) then the worker is considered to have left without checking out and counter
- if the worker reports in the morning when he arrives at work and does not check out and the next day when he arrives at work he does not report or logs off as being considered a mistake because it is impossible to spend more than 15 hours in the room, although this is practically very possible because there are magnetic locks on each door
- the calculation should be by items for the selected worker in the specified selected period
I posted the base with a message. The database is called Access, and the table where the reads are is called acc_monitor_log
I was stuck at the very beginning of calculating the time spent in the room and defining the items that go before: ENTRANCE goes before EXIT, as well as throwing out incorrect items (double entry or exit) and leaving only the correct ones. By what procedure do this?
Thanks