i've got a table for how staff spend their time in the day. below is an example.
we can see that lunch overlaps with the 2nd day work.
when users, try and key in a time period, i want to ensure that there is no overlap. if there is an overlap, i want to raise a promp to disallow them from adding the new time period. a time period can start from when the last period ended e.g. 12pm - 2pm, 2pm to 6pm. doesn't need to be 2:01pm.
what's the best way to do this?
SQL / VBA? i can do it with a lot of code in vba (k haven't thought exactly how to do it but it would require loops and all), but i have a really, really, really big suspicion that SQL can do this quite easily with joins and criteria.
hrmm i'm really not very good with SQL right now and now is the time when all the SQL is coming together (yay!! haha), so could someone help me out with the SQL or VBA if it's not possible in SQL? thanks!! = ))
(if it's VBA then just general directions will do, i can probably figure it out myself, just a matter of how optimised it is in VBA or not)
StartTime EndTime Category
9:00 AM 12:00 PM Work
12:00 PM 2:00 PM Lunch
1:00 PM 6:00 PM Work
thanks guys!! = ))