TERADATA timestamp from VARCHAR(22)



Hi,
I have a column in TERADATA table: time_stpm VACHAR(22)which contains
timestamps in the following format: DDMMMYYYY:HH:MM:SS.nnn (timestamp
imported from SAS 8.0 through ODBC using put statement (put
(timestamp,DATETIME22.3) )). For example:

time_stpm
08APR1999:00:00:00.000
14JAN1997:00:00:00.000
18JUL2000:00:00:00.000
....

What I want to do is to have a new column in TERADATA table containing
timestamp from column time_stmp which will have TIMESTAMP data type not
VARCHR(22).
I tried CAST like this:

select time_stpm,
CAST (time_stpm as TIMESTAMP (0) format 'DDMMMYYYY:HH:MM:SS.nnn') as
time_stpm_new

but it does not work.
Thanks for any help:)
Lolek

.



Relevant Pages