我有下面的两个表。我想计算hir_dt和月底之间的星期一至星期五的天数。既计算Hire_dt,也不计算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
预期结果:
id Hire_dt BusinessDaysBetween BusinessDaysBetween2
1 09/24/2018 5 4
查询:
Select last_day(hire-dt) - hire_dt --where to filter out sat and sunday?
from A