Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference TEXTTODATE
Functions and Expressions Reference Guide
203
TEXTTODATE
The TEXTTODATE function converts text that is in CCYYMMDD or YYMMDD format to
a date.
Syntax
TEXTTODATE ( single-text-expression )
Meaning
TEXTTODATE ( text_to_convert_to_date )
Returns
This function returns a single-date.
The
text_to_convert_to_date must be in either CCYYMMDD or YYMMDD format.
If the text_to_convert_to_date is in error (for example, it is not a valid date),
the result is NONE.
If text_to_convert_to_date is in YYMMDD format and is being assigned to a
date format that includes a century, the century is determined based on the
century run option setting using the YYLookup parameter or the current
century.
Examples
TEXTTODATE ( "990114" ) returns a single date item with the value of
January 14 in the year 99.
TEXTTODATE ( OrderDate ) returns OrderDate as a single date item.
Uses
Use
TEXTTODATE to convert a text item to a date. The TODATETIME function
provides greater flexibility as to specifying the format of the text item that is to
be converted to a date/time.
Related Functions
DATETOTEXT, NUMBERTOTEXT, TEXTTOTIME, TEXTTONUMBER,
TIMETOTEXT, TODATETIME