ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Help Converting Date (String Data) into Actual Date (i.e., MM/DD/YYYY)

Nameless_One
メテオロイド

Hi All,

 

Can someone please help me with creating a formula to convert string data for a date field into a usable date field in Alteryx? 

 

I already tried using the "DateTime" tool, but unfortunately it won't work with the way the raw data is coming out of my company's Oracle system.

 

I'm now trying to convert a string format of: "DD-JAN-20X1 00.00.00." see below.  This one's pretty trickly. I tried playing around with the formula tool (and using the "DateTimeParse" function, but I kept running into roadblocks).

 

Any help is greatly appreciated! Thanks so much.

 

Nameless_One_0-1666733606852.png

 

Nameless_One_1-1666733692858.png

 

 

7件の返信7
binu_acs
ポラリス

@Nameless_One One way of doing this with the DateTimeParse function

 

binuacs_0-1666734476446.png

to convert in to MM/DD/YYYY format use the DateTimeFormat function

 

DateTimeFormat(DateTimeParse([Date],'%d-%b-%Y %H.%M.%S'),'%m/%d/%Y')

 

binuacs_1-1666734609945.png

 

SPetrie
パルサー

If you want to use the Date Time tool instead of the formula @binu_acs suggested, you should be able to use a setup like this as well.

 

SPetrie_1-1666734635863.png

 

ShankerV
キャスター

Hi @Nameless_One 

 

As you are no longer worried about time, you can use the DateTime tool in the below format to overcome your issue.

 

Also make sure that, you have used dd-Mon-yyyy not as dd-Month-yyyy which might be the root cause of your issue.

 

dd-Mon-yyyy -> Works when your input is 01-Apr-2006 00.00.00

dd-Month-yyyy -> Works when your input is 01-April-2006 00.00.00

 

Hope this helps!!!

Solution.jpg

 

Nameless_One
メテオロイド

Unfortunately, this isn't working. I'm getting the below error:

Nameless_One_0-1666739524528.png

 

Nameless_One_1-1666739538107.png

 

gautiergodard
パルサー

@Nameless_One If you are just looking for the date, please see attached! 

 

You can use formula below:

 

datetimeparse(left([Date],11),'%d-%b-%Y')
gautiergodard
パルサー

Hello @Nameless_One 

If this post provided you with the answer to your question, please accept it as a solution so that other in the community may reference it in the future.

 

Thank you!

Nameless_One
メテオロイド

Thank you! The DateTime tool solution seemed the most practical solution that worked when I exported the date output. 

 

ラベル
トップのソリューション投稿者