Hi everyone. I hope someone can help me. I have shipped date and delivered date. I need to find the total days that it took to ship minus weekends and holidays. I have tables that stores business days as 0 for not business day and 1 as business day, and a table that has Holiday as 0 for no holiday and 1 as a holiday.
Are you saying you have a Date table that looks something like this?
Date | WeekDayName | BusinessDay | Holiday |
2018-12-31 | Thursday | 1 | 0 |
2019-01-01 | Friday | 1 | 1 |
2019-01-02 | Saturday | 0 | 0 |
2019-01-03 | Sunday | 0 | 0 |
2019-01-04 | Monday | 1 | 0 |
How about computing whether or not it is a package travel day
case when Holiday = 1 then 0
when BusinessDay = 0 then 0
else 1
(The security rules of this site are blocking me from uploading more complete SQL in a code block.)