Alteryx Designer Desktop Discussions

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

Sting field to dateformat.

olehr
8 - Asteroid

Hi there, 

 

I have got a dataset with the with a "dateCreated" field.  However, the field is a sting field, and the format of the date is for eks 08.19  (month,year) in this case. 

 

I would like to make this field into a datetime format, and have tried the formula:  DateTimeFormat(DateTimeParse([String],"%m.%y"),"%m/%Y"), but it does not work as it reports [null] in my new column. 

 

Any suggestions ? 🙂

2 REPLIES 2
RolandSchubert
16 - Nebula
16 - Nebula

Hi @olehr ,

 

to turn the string field you have into a datetime field, you only need DateTimeParse([String], '%m.%y') and assign the Fieldtype "Date".

02-12-_2019_13-39-37.png

 

DateTimeFormat reconverts it to a string, so it will return NULL in a date field.

Does this help?

 

Regards

 

Roland

Jean-Balteryx
16 - Nebula
16 - Nebula

Hi @olehr !

 

To achieve what you want in an easier way than using a Formula tool, you can use a DateTime Tool.

 

By selecting the option "String to Date/Time format" and specifying your input format, here "MM.yy", you'll get your information in Date format.

 

I attached an example workflow.

 

Don't hesitate to ask for more details.

 

Have a great day !

Labels