a guest Oct 12th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- cross apply (SELECT
- sum(case when [day] between @FirstDay and @LastDay then 1 else 0 end) as UsedDays
- FROM Calendar c
- WHERE ([day] >= r.[DateFrom] AND [day] <= r.[DateTo] AND [WorkDay] = 1))calculateUsedDays
RAW Paste Data