community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

converting data type from string to date

Asteroid

Dear all,
I am trying to change the format of the date from 2019-02-31 to 31/02/2019 i.e. from yyyy-mm-dd to dd/mm/yyyy.
I am able to convert it but the datatype i am getting is string.
If I try to change the datatype to date, I am getting null as output.

2019-02-31 i used date time tool to convert the date into string, later i used select tool to change datatype to date, but output is null.
Please help me with this.

Thank you 

Alteryx Partner

Hi @Ekta 

 

The date field format used by Alteryx is YYYY-mm-dd. Because you have converted it into dd/mm/YYYY, it is recognised as a string field. 

 

If you are using the date field in any formulas, use UTC format and if you need to convert it into dd/mm/YYYY then I would suggest to do it at the end of your workflow.

 

- Andrew

Highlighted
Asteroid

Hi Andrew, 

thank a lot for the reply. 

if i am converting the date format to dd/mm/yyyy in the end of the workflow also, the data type is still string .possible if i can convert the data type to date?

when i am changing the datatype using select tool. its giving me null.

 

Thank you 

Alteryx Certified Partner

Hi @Ekta 

 

May be this can help you.

 

Take a look at this workflow

 

Best Regards

Aurora

Hi @Ekta 

 

The only format supported by the Alteryx Date data type is yyyy-mm-dd.  Any other format must be stored in a string field.  If your date is not in this format, using the Select tool to change the field type to date will always result in null.

 

Why do you need this field to be a date field.   Do you need to use it in date calculations?  If yes, do your calculations before changing the format.  If you really convert it just before the output, then the output file will reflect exactly the format in the string field.  If your output is an excel file, when you open it in Excel it will show up as a date value.  if your output is a csv, the the string will be in the csv file in dd/mm/yyyy format.

 

Dan

Labels