cancel
Showing results for 
Search instead for 
Did you mean: 

Date conversion

Highlighted

Hi, I've been looking through the forums but haven't quite figured out my date conversion problem.

 

The date format I have is: 12/30/2017 17:29:42:123

The date format I would like is 20171230

 

I have tried a few different formulas but when I get to actually converting the date format I get a conversion error saying the date is not valid.

 

I have tried trimming the left 10 digits but due to some dates being 1/5/2017 they come out with a 0 at the end.

 

Thank you for any help.

 

ivoller
Bolide

Hi,

 

DateTimeFormat(DateTimeParse([Date],"%m/%d/%y"),"%Y%m%d") should work ...

 

Cheers,

Iain

ivoller
Bolide

See attached.

 

Iain2018-03-11_16-13-11.png

LordNeilLord
Alteryx Certified Partner

Hey @Rrmbinson10

 

Try this formula:

 

DateTimeFormat(DateTimeParse(Left([Date],Length(Date)-4),"%m/%d/%Y %H:%M:%S"),"%Y%m%d")

Use this guide for dateformats: https://help.alteryx.com/9.5/Reference/DateTimeFunctions.htm

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover