Employee Schedules


I have a technician table and a technician_schedule table fkey/ref using employee_id.

In the technician table I have a column called available_days EnumList where you pick days the technician can work (Sun-Sat) that ref a day table. This available_days column is set up the same way on the technician_schedule table.

In the technician_schedule table I have 2 date selectors called:


and a virtual column called total_days that has the expression:

DAY([start_date]) + DAY([end_date])

This shows me how many days are in between the dates, but I need to know how many days are between the dates that the employee actually works. So if they only work Sundays and I select 3 months, it should return 12 days.

I imagine a SELECT expression would grab the days they work and then use that to filter the days between the selectors, but after a bit of searching, I figured it’s time for some help.

Thank you in advanced.