Hello all,
How to calculate total number of WEEKDAYS between two dates?
Custome activity I used is giving me incorrect result. I want to exclude Saturday and Sunday.
Hi @sarathi125 …Thanks…but it is printing all dates between 2 given dates…but the user asked only for business days excluding weekends…Do we have to tweak your flow?
I have tried this package… It is I guess including Saturday in working days… in calculation it is giving one day more than weekdays.
Thanks @sarathi125 … I only want the number of weekdays between two dates in INT format… how can I get this…?
@7387023380 - Nope…its working fine…Please have a look here…You can see it did not printed 20 and 21.
Check this below code, @7387023380
TotalDays = 1 + ((Cdate(“02/14/2021”) - Cdate(“02/01/2021”)).TotalDays * 5 - (CDate(“02/01/2021”).DayOfWeek - Cdate(“02/14/2021”).DayOfWeek) * 2) / 7.
And code is in the form of,
TotalDays = 1 + (EndDate - StartDate).TotalDays * 5 - (StartDate.DayOfWeek - EndDate .DayOfWeek) * 2) / 7.
EndDate and StartDate should be in - “MM/dd/yyyy” format
This will give you the total days excluding the Saturday and Sunday.
Hope this may help you
Thanks @sarathi125- ur code is working for me
@prasath17- this packg activity also working @Manish540 - got the solution…
Thanks all for quick solution
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.