Been out of SQL for a while. What would be the best strategy to determine the below calculation?
Swi
Code:
Days-in-System Calculation
Days in System = (Last Scan Date – First Scan Date) – (Adjustment for Sunday/Holiday)
The adjustment for Sunday/Holiday is determined using the following logic:
a. If the last scan date falls on a day immediately following a Sunday or holiday, then subtract 1 from the days-in-system value.
b. If the last scan date falls on a day immediately following a Sunday, and that Sunday is immediately preceded by a holiday, then subtract 2 from the days-in-system value.
Swi