Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

convert string to timestamp - response (2) by CarlosAL

$
0
0
Sorry, pressed the key too soon: If you have your timestamp strings in a fixed-length format, you can do something like: SELECT CAST(SUBSTR(THE_TS_STRING,1,18) ||             SUBSTR(THE_TS_STRING, 29,3) AS TIMESTAMP(0) FORMAT 'DD-MMM-YYbhh.mi.ssbT') THE_TIMESTAMP        FROM (SELECT '05-mar-12 01.33.34.000000000 pm' THE_TS_STRING) PRE;  *** Query completed. One row found. One column returned.  *** Total elapsed time was 1 second.         THE_TIMESTAMP --------------------- 05-Mar-12 01.33.34 PM HTH Cheers. Carlos.

Viewing all articles
Browse latest Browse all 14773

Trending Articles