Hi all.
I have a formula that sum(adds) +2 days into a basic date column for later use. The problem is, it's summing with weekend days. For example;
3th of June -> Friday.
What should be done:
Formula adds two days desconsidering weekends, in this case the result would be 7th of June.
What is happening:
Formula is giving the result of 5th of June.
DateTimeFormat(DateTimeAdd(DateTimeParse([DATA_MOVIMENTO],"%Y-%m-%d"),+2,"days"),"%Y-%m-%d")
DATA_MOVIMENTO = 3th of June btw as 2022-06-03.
How to avoid that?
Thanks
Solved! Go to Solution.
Hey @Joker_Hazard,
Here is one solution to this problem:
This formula:
IF DateTimeFormat(DateTimeAdd([DATA_MOVIMENTO],1,"days"),"%A") = "Saturday"
THEN
DateTimeAdd([DATA_MOVIMENTO],4,"days")
ELSEIF
DateTimeFormat(DateTimeAdd([DATA_MOVIMENTO],1,"days"),"%A") = "Sunday"
THEN
DateTimeAdd([DATA_MOVIMENTO],3,"days")
ELSE
DateTimeAdd([DATA_MOVIMENTO],2,"days")
ENDIF
Checks the next day after the given date if its Saturday then add 4 days if Sunday add 3 else just add 2 days.
Any questions or issues please ask :)
HTH!
Ira
Not sure if you need the Sunday check if non of your dates are Saturday. If you have no Saturdays should be fine to remove the Sunday check 👍