Hi guys!
I would like to know how to define the end of the week, for example counting only from Monday to Friday, to count the working days in a report, if the inspection was carried out daily!
Ty!
Solved! Go to Solution.
Hi @Silva_BR,
The weekday function is useful for this. That will return a number for each day. Saturday is 7, Sunday is 1.
So in your example you only want weekdays from 2 to 6.
Below is an example of using that weekday function.
Weekday(StartDate.SelectedDate)
You could even calculate the workdays by using datediff and rounddown functions with that. In this Microsoft blog there is a description of that approach:
RoundDown(DateDiff(StartDate.SelectedDate, EndDate.SelectedDate, Days) / 7, 0) * 5 +
Mod(5 + Weekday(EndDate.SelectedDate) - Weekday(StartDate.SelectedDate), 5)
Hi @Silva_BR,
The weekday function is useful for this. That will return a number for each day. Saturday is 7, Sunday is 1.
So in your example you only want weekdays from 2 to 6.
Below is an example of using that weekday function.
Weekday(StartDate.SelectedDate)
You could even calculate the workdays by using datediff and rounddown functions with that. In this Microsoft blog there is a description of that approach:
RoundDown(DateDiff(StartDate.SelectedDate, EndDate.SelectedDate, Days) / 7, 0) * 5 +
Mod(5 + Weekday(EndDate.SelectedDate) - Weekday(StartDate.SelectedDate), 5)
User | Count |
---|---|
157 | |
86 | |
68 | |
63 | |
61 |
User | Count |
---|---|
211 | |
152 | |
93 | |
81 | |
70 |