I have the below two table. I want to calculate the number of days, Monday-Friday between hire_dt and the end of month. Both counting the Hire_dt and not counting the hire_dt.
id Hire_dt
1 9/24/2018
TableB
calendar_dt day_of_week EOM WorkDay
09/24/2018 Monday 09/30/2018 1
Expected Results:
id Hire_dt BusinessDaysBetween BusinessDaysBetween2
1 09/24/2018 5 4
Query:
Select last_day(hire-dt) - hire_dt --where to filter out sat and sunday?
from A