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

Alteryx designer Discussions

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

Looks aren't everything... But the latest Community refresh looks darn good!

Learn More

Convert yyyymmdd to a date field

Highlighted

Hi masters

 

I would like to covert say 20171026 to 26/10/2017 in AlteryX. I tried the DateTime tool and got the error "ConvError: DateTime (643): DateTime_Out: Cannot convert "20171026" to a date/time with format "%d/%m/%Y": Expected separator '/%m/%Y', got: '171026' Record #1.

 

What am I doing wrong?

 

Thanks!

Gundam

Bolide

@gundam_pilot,

 

Not sure exactly how you are going about this but I would Convert the 20171026 to a string and then use the DateTime tool to convert it to a Date in standard alteryx format. Then use a formula tool utilizing the DateTimeFormat() function. Example workflow attached.

 

Best,

MSalvage

Asteroid

@gundam_pilot Here’s one approach… if the field type is a string, you can use the DateTime tool to convert the string to the Alteryx date format (incoming format = yyyyMMdd). Then use another DateTime tool to convert the date to the dd/MM/yyyy format.

Alteryx Certified Partner

@gundam_pilot,

 

Here's a formula that will output your desired date format. Note that this is assuming that the field you're targeting is a string. 

 

DATETIMEFORMAT(
DATETIMEPARSE([Field1],'%Y%m%d')
,'%d/%m/%Y')
Labels