Search code examples
stringtimestampteradatadate-format

How to read string column in format ‘15Aug21:12:45:24’ as time stamp in Tera data?


I have a character column in teradata table with format like this - ‘15AUG21:06:38:03’. I need to convert this column into time stamp so that I can use this column in order by statement. I am using teradata sql assistant to read data.


Solution

  • Use TO_TIMESTAMP:

    SELECT TO_TIMESTAMP ('15AUG21:06:38:03', 'DDMONYY:HH24:MI:SS');