Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Date Conversion

Dom
8 - Asteroid

Hello, I need to convert the Date of Birth date from 05/28/1956 to yyyymmdd. I'm confused as to which date format to use.

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus

The string needs to be converted to a date.

 

YYYY-MM-DD is the format of data that will populate into a DATE field.

 

RIGHT([Field],4)+'-'+SUBSTRING([FIELD],3,2)+'-'+LEFT([FIELD],2)

 

is the formula to use on a string that looks like:  MM-DD-YYYY

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
MattD
Alteryx Alumni (Retired)

Hey Dom!

 

Try datetimeparse([Test],"%m/%d/%Y").

 

Best of luck,

Matt

Former Alteryx, Inc. Support Engineer, Community Data Architect, Data Scientist then Data Engineer
michael_treadwell
ACE Emeritus
ACE Emeritus

You need to use the DATETIMEFORMAT() function. That being said, DATETIMEFORMAT() will only format a DateTime field. You will first need to make sure that 05/28/1956 is a DateTime because Alteryx will probably read it as a String.

 

As for the operators to use, you can find examples of those here: http://downloads.alteryx.com/Alteryx8.6.2/WebHelp/Reference/DateTimeFunctions.htm

Labels
Top Solution Authors