I want to calculate no. of working hours between two given dates(excluding weekends) and it should be within business hours(8:00 AM - 5:00 PM).
I have 3 tables:
- table 1 contains open dates and closed dates for different jobs.
- table 2 contains the working hours(2 columns start time(8:00 AM) and end time(5:00 PM)).
- Table 3 contains date and the day on that date.
For eg.
open date - 2015-10-16 06:00:00 & closed date - 2015-10-19 15:00:00 working_hours_start - 8:00 AM & working_hours_end - 5:00 PM
Answer - 16 hrs