Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How to convert DD-Mon-YYYY(string format) to DD-Mon-YYYY(string format) in date format

jyotibarai
5 - Atom

How to convert DD-Mon-YYYY(string format) to DD-Mon-YYYY(string format) in date format

 

I am using data from Postgre DB where I have Date format: 2020-01-21 and I am expecting the output 21-Jan-2020 as a Date data type in alteryx.

 

I have tried the approach from the below link but I am getting Null as output.

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Date-Formatting-dd-Mon-YYYY/td-p/40915...

 

jyotibarai_0-1579612981308.png

 

Error Message 

ConvError: Formula (49): DATETIMEPARSE: Cannot convert "08-Dec-2019" to a date/time with format "%Y-%m-%d": Expected a number for Month: 'Dec-2019'

 

Output :

 

jyotibarai_1-1579613114401.png

 

Can anyone help to resolve this asap?

3 REPLIES 3
JosephSerpis
17 - Castor
17 - Castor

Hi @jyotibarai Alteryx can only accept the format of a date as YYYY-MM-DD so that is why your output formula is not working. As I can see from your screenshot you have already formatted as DD-Mon-YYYY as a string field that is the only way Alteryx would be able to handle that date in that format being recognized  as a string field. If you need to perform any additional data time functions you would need to use the Visit column as that in the format Alteryx recognizes as a date format. 

afv2688
16 - Nebula
16 - Nebula

Hello @jyotibarai,

 

Are you looking for this? "DateTimeFormat([Field1],'%d-%b-%Y')"

 

Untitled.png

 

This dates can only be format as String. To have them output as date they have always to be in yyyy-mm-dd format.

Regards

jyotibarai
5 - Atom
Thank you all for helping me and providing a quick response to this. I am using the excel file to write the data and it is exporting back as a string because of Alteryx string output. So now the only option left with me is to use the Excel Macro to convert that into a date. 
Labels