how to cast a string field into date format?

Database
Enthusiast

how to cast a string field into date format?

 
 
 
1 REPLY
Teradata Employee

Re: how to cast a string field into date format?

Depending on the format of the string, perhaps TO_DATE(string,'to_date_format') or CAST(string AS DATE FORMAT 'teradata_format') will be enough to turn a formatted string into a DATE data type. Or maybe you need to do some string manipulations first.

(Note that format string definitions differ between the two approaches.)