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

timsmith
6 - Meteoroid

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

 

I've gotten the date into this format:

 

3 Feb. 2008

 

and have tried this formula to get it into a date format:

 

DateTimeFormat(DateTimeParse([Date2],'%d/%b/%Y'),'%m-%d-%Y')

 

but I get null values where the day is a single digit, e.g.: 3 Feb. 2008

 

Specifically, I get a message that the day of month value is out of range 1..31.  Somehow, when the day is a single digit, the month value isn't seen properly.

 

Thank you for any help.

12 REPLIES 12
timsmith
6 - Meteoroid

When I added a full year's worth of data, I see that because "May" is not abbreviated with a period at the end, I get null values for all dates in May.  Is there any way to adjust the Regex so that it works for May dates?

Tim

MarqueeCrew
20 - Arcturus
20 - Arcturus

put the following in front of your formula:

 

REPLACE(

 

Then put this at the end:

 

,"May.",'May')

 

That will cause only May to lose the .

 

:)

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
timsmith
6 - Meteoroid

That works -- thanks very much!

-Tim

Labels
Top Solution Authors