Hi there,
I'm posting here under queries even though the solution may be something else....
I've checked all over the web and here and have found some examples that come close but not exactly what I'm looking for.
I have designed and maintain the recruitment databases (in Access) that run 2 employment agencies in a kind of brother/sister company scenario. Internal staff book our employees on varying shifts that can run during the day but can also traverse midnight. The time calculations are all sorted, thanks to this forum. However, I'm having a problem accounting for any overlapping shifts...
Example:
Client: Employee: Shift Start: Shift End:
Client 1 Employee 1 06:00 10:00
Client 2 Employee 2 08:00 15:00
Client 2 Employee 3 12:00 -midday 16:00
Client 3 Employee 3 15:00 00:00 (midnight)
Client 3 Employee 4 16:00 04:00 - next day - very early!
Client 3 Employee 4 18:00 23:00
Okay, you can see that Employee 3 and 4 have overlapping shifts...and I'm wondering what kind of query, SQL, or VBA code would be the most elegant way of listing ONLY the overlaps in a separate form to alert internal staff they have double-booked an employee...I've tried the wonderful Mr Allen Browne's model but can't seem to get it to work for this scenario, though that's probably my stupidness LOL
I'm not concerned with Clients - all I need to do is find overlapping shifts of an employee irrespective of which client they are working for...
Many thanks in advance if anyone can help me
dazza61
I'm posting here under queries even though the solution may be something else....
I've checked all over the web and here and have found some examples that come close but not exactly what I'm looking for.
I have designed and maintain the recruitment databases (in Access) that run 2 employment agencies in a kind of brother/sister company scenario. Internal staff book our employees on varying shifts that can run during the day but can also traverse midnight. The time calculations are all sorted, thanks to this forum. However, I'm having a problem accounting for any overlapping shifts...
Example:
Client: Employee: Shift Start: Shift End:
Client 1 Employee 1 06:00 10:00
Client 2 Employee 2 08:00 15:00
Client 2 Employee 3 12:00 -midday 16:00
Client 3 Employee 3 15:00 00:00 (midnight)
Client 3 Employee 4 16:00 04:00 - next day - very early!
Client 3 Employee 4 18:00 23:00
Okay, you can see that Employee 3 and 4 have overlapping shifts...and I'm wondering what kind of query, SQL, or VBA code would be the most elegant way of listing ONLY the overlaps in a separate form to alert internal staff they have double-booked an employee...I've tried the wonderful Mr Allen Browne's model but can't seem to get it to work for this scenario, though that's probably my stupidness LOL
I'm not concerned with Clients - all I need to do is find overlapping shifts of an employee irrespective of which client they are working for...
Many thanks in advance if anyone can help me
dazza61
Last edited: