Hi, Team!
I want to calculate the current day minus 5 working days.
e.g. 04.06.2020-5 working days = 27.05.2020
Can you help me with an idea?
Thank you in advance
Hi, Team!
I want to calculate the current day minus 5 working days.
e.g. 04.06.2020-5 working days = 27.05.2020
Can you help me with an idea?
Thank you in advance
Since working days are typically Monday - Friday, you can use Now.AddDays(-7)
if CInt(Now.DayOfWeek) >= 1 AndAlso CInt(Now.DayOfWeek) <= 5
. Otherwise, use Now.AddDays(-5)
if CInt(Now.DayOfWeek) = 6
, or Now.AddDays(-6)
if CInt(Now.DayOfWeek) = 0
.
Keep in mind that this does not account for holidays.
Worked!
Thank you for your support!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.