We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Change a String to date.

DataPirate26
10 - Fireball

I have a string field where the data is as 20160826(YYYYMMDD). The first 4 letters is the year the next 2 is the month and the last 2 is the date. I want to change this Field to date format. Output will show as ( 2016-08-26). Can someone help me to achieve this

5 REPLIES 5
MarqueeCrew
20 - Arcturus
20 - Arcturus

@DataPirate26 ,

 

 you would like to use the datetimeparse() function. 

%Y is there for digit year, %m and %d are the month and day specified.  

Daterimeparse([text],"%Y%m%d")

 

 when used to define a new date field this will work for you. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
DataPirate26
10 - Fireball

That worked perfectly. Thanx for the quick help.

Qiu
21 - Polaris
21 - Polaris

@DataPirate26 
We can also use the DateTime Tool which is might be easier to understand.

0622-DataPirate26.PNG

DataPirate26
10 - Fireball

Sorry for the delayed response. This also worked perfectly. Thanx for all your help and suggestions

Qiu
21 - Polaris
21 - Polaris

@DataPirate26 
Good to know it helps.

Labels
Top Solution Authors