Reference Guide > TDV Support for SQL Functions > TDV-Supported Convert Functions > PARSE_DATE
 
PARSE_DATE
The PARSE_DATE function outputs a DATE by parsing the first argument using the format defined by the second argument.
Syntax
PARSE_DATE (date_string, format_string)
Remarks
The date_string must be a CHAR or VARCHAR.
The format_string must also be a CHAR or VARCHAR, and must follow the same string format as the FORMAT_DATE function.
The format_string must not contain any non-date elements such as hours, minutes, or seconds.
When the two-digit year format 'yy' is used as the format string, 50 is parsed as the year 1950, but 49 is parsed as the year 2049.
Examples
PARSE_DATE ('MARCH 06, 49', 'MONTH dd, yy')
 
This results in a DATE value of 2049-03-06.
PARSE_DATE ('JAN 06, 2007', 'MON dd, yyyy')
 
This results in a DATE value of 2007-01-06.
PARSE_DATE ('MARCH 06, 50', 'MONTH dd, yy')
 
This results in a DATE value of 1950-03-06.