Alteryx Designer Desktop Discussions

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

Date formatting - formula

Redzapplin
8 - Asteroid

Hi all, 

 

I wanted to convert my date to month and year with an extra zero.

 

if my date i 27-02-2020 then my calculation should say 002.2020

or if my date says 30-12-2020 then calculation should say 012.2020.. I want to use it in my date prompt

 

any leads using regex or anything will help. thanks

6 REPLIES 6
RolandSchubert
16 - Nebula
16 - Nebula

Hi @Redzapplin ,

 

you'll ave to convert the date to a date data type and format the date to get the result you need. 

The formula:

DateTimeFormat(DateTimeParse([Field1], '%d-%m-%Y'), '0%m.%Y') 

should do the job.

 

Hope this is helpful.

 

Best,

 

Roland

Redzapplin
8 - Asteroid

Hi @RolandSchubert,

 

I am getting a null. Ideally I am looking for something that I have attached  

 

 

RolandSchubert
16 - Nebula
16 - Nebula

Do you want to select a date using the Date tool and convert this date to the format '0mm.yyyy'? Or is the a comparison of dates (input against the selected date)?

Redzapplin
8 - Asteroid

Exactly!

 

Sorry for the confusion.

RolandSchubert
16 - Nebula
16 - Nebula

I think, this should work. 

 

Select a date:

03-04-_2020_14-51-12.png

 

The result will be:

03-04-_2020_14-51-29.png

 

Let m know, if it works for you.

 

Best,

 

Roland

Redzapplin
8 - Asteroid

@RolandSchubert  You are "AWESOME"

Labels