I have the following table:
id | roomid | courseid | day(NUM) | start(TIME) | end(TIME)
This is one part of larget query that I am stuck with. How can I show all id’s that have NO time break in between courses in specific rooms on specific day? Kind of stuck here.
I guess I have to use ‘ADDTIME()’ function to to find out the difference in course1 end time and course 2start time => that have 0. I have been looking at it for quite some time now and I am stuck!
If all you are interested in is full utilisation.
If a day is say 7 hours, (9-5 – 1 hour lunch break), call it 420 minutes to make things easy.
Then 420 – Sum(MINUTE(TIMEDIFF(t2,t1)) = 0 would mean the room was fully booked up.