Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

make today's date with the specified date

Ar13f
10 - Fireball

Dear All,

 

if I change the date as in the output column taken from the next column, what is the formula? (the year changes to 2021 but the month and date are the same)

 

Date InvoiceOutput
2002-08-292021-08-09
2008-10-092021-10-09
2010-11-202021-11-20

 

I tried to construct the year, but I couldn't figure out how to add the month and day. Perhaps you have a better formula than I do. Thank you in advance.

 

Years-Test.png

2 REPLIES 2
danilang
19 - Altair
19 - Altair

Hi @Ar13f 

 

You can use ToString(DatetimeYear(DateTimeToday()))+Substring([Date Invoice],4).  Just watch out for leap years.  2008-02-29 is a valid date, but 2021-02-29 isn't.  You'll have to decide what to do in these cases.

 

Dan

Ar13f
10 - Fireball

Dear @danilang 

 

I hope you and family in good health ...

 

thank you for your advice .... 

 

 

regards,

Arief

Labels