That's a variation of the common problem "how many working days were needed to process this task":
Add a new SMALLINT column to your calendar table like holiday_seqnum and populate it once with a running number using
SUM(case when weekend then 1 else 0 end) over (order by calendardate rows unbounded preceding).
Now it's two joins to your calendar and a simple difference of the holiday_seqnums of Resignation_Date and Joining_Date.
Of course you might do the same for working days or simply do number of days between star end end minus number of holidays:-)
That's a variation of the common problem "how many working days were needed to process this task":
Add a new SMALLINT column to your calendar table like holiday_seqnum and populate it once with a running number using
SUM(case when weekend then 1 else 0 end) over (order by calendardate rows unbounded preceding).
Now it's two joins to your calendar and a simple difference of the holiday_seqnums of Resignation_Date and Joining_Date.
Of course you might do the same for working days or simply do number of days between star end end minus number of holidays:-)
Dieter