Blending_Produc wrote:
Hi Alexey!
Forgiveness! I was wrong, I just edited the post.
Just explaining my idea a little better: I would like that whenever I add a purchase with a credit card to my table, the formula will return me the next invoice closing.
Thank you very much for reporting the error in my question!
Edit: I think I got it!
IF(DATETIME_FORMAT({Purchase Date}, ‘DD’)>=02, DATETIME_FORMAT(DATEADD({Purchase Date}, 1, ‘month’), ‘02/MM/YYYY’), DATETIME_FORMAT(TODAY(), ‘02/MM/YYYY’))
What do you think?
The only question now would be to be able to adapt this to a rule like: If the close date is not a business day, show me the next business day. Can you help me, please?
You may simplify a bit
DATETIME_FORMAT(DATEADD({Purchase Date},
(DAY({Purchase Date}!=1)
, 'month'), '02/MM/YYYY')
regarding business day, i’ll check what formulas are available and answer later.
that will target 1st day of next month (or this, if DAY{Purchase Date}) is 1 )
usually that (true=1, false=0)works without " 1* "
, but here not. So it’s for implicit conversion
DATEADD(
DATEADD({Purchase Date},
1*(DAY({Purchase Date})!=1),'month'),
1-DAY({Purchase Date}),'days')
And pass it to closest workday
workday(
DATEADD(
DATEADD({Purchase Date},
1*(DAY({Purchase Date})!=1),'month'),
1-DAY({Purchase Date}),'days')
,1)
seems like it works. Further format operations - up to you