Hi

How to get two business days from today(getdate()) exclude weekend and holidays?

Holiday table:

Create Table Holiday_Table( HDate date)

Insert INTO Holiday_Table(HDate)

values ('2021-12-31')

,('2021-12-28')

,('2021-12-27')

,('2021-12-24')

,('2021-11-26')

,('2021-11-25')

,('2021-09-06')

## Result:

if getdate()='2021-09-07' then result should be '2021-09-02'

if getdate()='2021-11-29' then result should be '2021-11-23'

if getdate()='2021-11-30' then result should be '2021-11-24'

if getdate()='2021-12-29' then result should be '2021-12-22'