community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

To check if a date column is in YYYY-MM-DD format, if not to give "Fail" as the result

Meteoroid

Hi,

 

I am new to Alteryx and I have a use case to test if the column has records with date displayed in "YYYY-MM-DD" format. If not, I have to mark the result as fail. Any help on this is really appreciated..

Alteryx Certified Partner
Alteryx Certified Partner

Hi @sucansa I mocked up an example using this syntax in a formula. I attached the workflow let me know what you think?

 

IF DateTimeFormat([Date],"%Y-%m-%d")=[Date] THEN "Yes" ELSE "Fail" ENDIF 

 

Dates_Test_021019.PNG

Alteryx
Alteryx

@JosephSerpis 's solution has the added benefit of not just checking the syntax but verifying that the date is valid without doing a bunch of extra checks. So 2019-02-29 may have the right syntax but still be rejected.

Alteryx
Alteryx

ignore me

Highlighted
Meteoroid

Thank you! This worked the magic.

Labels