How to Standardize Date Columns

Goal

Learn how to standardize incoming dates so they have the same format and to prevent dates from being read in multiple formats, such as 1989-06-15 also being 06-15-1989.

Learn

You can use MATCHES and regular expressions. The following formula standardizes all dates:

IF(MATCHES(#dateStringColumn; ”^\\d{4}-.+”); ASDATE(#dateStringColumn; "yyyy-MM-dd”); ASDATE(#dateStringColumn; "MM-dd-yyyy”))

Further Information

ASDATE and Date and Time Parse Patterns