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

Help with Date formatting for counting days

katherinetdavita
8 - Asteroid

I am apparently very date format challenged. I'm trying to work from a Hire date as in the attached sample data to find number of days employed. I found a formula from another post but am getting warnings "DateTimeParse: Cannot convert "2013-01-21" to a date/time with format "%YYYY%mm%dd" and language "English": Expected separator 'YYYY%mm%dd', got '2013-01-21"

 

Help. please.

2 REPLIES 2
JosephSerpis
17 - Castor
17 - Castor

Hi @katherinetdavita the following format is what is needed for your data DateTimeParse([Hire Date],"%Y-%m-%d"). You need to match the format of your data the specifiers for datetime can be found here. As your data is in ISO format of YYYY-MM-DD you can sometimes can get away with using a select tool to change the format to date format. However I would always check this and ensure that the select tool does not null my data which is typical behaviour if you change the data type to date without it being in the correct format.

katherinetdavita
8 - Asteroid

Amazing, thank you!!!

Labels
Top Solution Authors