Guest User

Untitled

a guest
Oct 12th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. cross apply (SELECT
  2. sum(case when [day] between @FirstDay and @LastDay then 1 else 0 end) as UsedDays
  3. FROM Calendar c
  4. WHERE ([day] >= r.[DateFrom] AND [day] <= r.[DateTo] AND [WorkDay] = 1))calculateUsedDays
Add Comment
Please, Sign In to add comment