I Would Like To Count The Number Of Days Between Start Day [Start] and End Date [Finish];
My Current Code Works Fine, But Includes Weekends,
_days_between (IF ([Finish] is missing) THEN (current_date) ELSE (cast([Finish] as date)),cast([Start] as date)) + 1
Edit (Based On Alexey Baturin Answer):
1 + 5 * (_days_between (cast([Finish] as date);cast([Start] as date))
-_day_of_week (cast([Finish] as date);1)+_day_of_week (cast([Start] as date);1))/7
- if (_day_of_week (cast([Start] as date);1) > 5) then (6) else (_day_of_week (cast([Start] as date);1))
+ if (_day_of_week (cast([Finish] as date);1) > 5) then (5) else (_day_of_week (cast([Finish] as date);1))
I Now Have This Code But This Doesn't Include If [Finish] Is Missing.
Try
Or simpler, to make the idea of calculation clear.
End of year bug fixed