Alteryx Designer Desktop Discussions

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

Conversion of Date & Time format

RanjanKT
8 - Asteroid

Hi Team,

 

Can some one help me to convert the Below Date(MMDDYYYY HHMM) field to (YYYY-MM-DD) format.

 

I have tried using the  DateTimeParse([AnticipatedWinDate], "%Y-%m-%d") formula, But some how i am getting the error saying.

"ConvError: Formula (14): DATETIMEPARSE: Cannot convert "Oct 30 201" to a date/time with format "%YY-%m-%d": Expected a number for year: 'Oct 30 201'":

 

The format is as below.

Untitled.jpg

10 REPLIES 10
LordNeilLord
15 - Aurora

Hey @RanjanKT 

 

DateTimeParse wants you to specify the format that the data is currently in, not what you want it output like

 

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@RanjanKT ,

 

Please try this:

 

DateTimeParse(Left([AnticipatedWinDate],11), "%b %d %Y")

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
JosephSerpis
17 - Castor
17 - Castor

Hi @RanjanKT if you use the datetime tool and following format it should work.Datetime_Parse.JPG

RanjanKT
8 - Asteroid

Thanks for the response.

 

encountering the below error.

 

ConvError: Formula (14): DATETIMEPARSE: Cannot convert "Oct 30 201" to a date/time with format "%b %d %Y": Year number is out of range 1400..9999: '201'

 

and the dated are appearing "Oct 30 201"

RanjanKT
8 - Asteroid

Thanks for the response.

 

For some reason i am getting the below error.

 

ConvError: DateTime (25): DateTime_Out: Cannot convert "Oct 30 201" to a date/time with format "%m/%d/%Y %H:%M:%S": Expected a number for Month: 'Oct 30 201' Record #5

RanjanKT
8 - Asteroid

i have tried both the possibilities. But the Out put is reflecting null. and the existing field format is changing.

 

Untitled.jpg

MarqueeCrew
20 - Arcturus
20 - Arcturus

I can't explain why the left 11 positions of that date are only reading 10 bytes.  If there are junk characters in the data would be my only guess.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
RanjanKT
8 - Asteroid
Thanks you. The date is pulled from the SQL server. and it is like below. Feb 2 2018 12:00AM Cheers!
NataliiaC
5 - Atom

Hi, i'm facing similar problem - can't convert m/d/yyyy format.

Any ideas as to what the problem is will be very appreciated!

 

Thanks!

 

NataliiaC_0-1620490841657.png

NataliiaC_1-1620490856475.png

 

Labels