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
Add Comment
Please, Sign In to add comment