Archives of the TeradataForum
Message Posted: Sun, 28 Aug 2016 @ 19:38:00 GMT
Subj: | | Re: Timestamp conversion to timestamp(0) |
|
From: | | Johnpaul J |
Thank you Sherwin, Danny and Vinay!
There was some date format issue. Finally I have used below syntax
CAST( CAST(trim(
case when position( ' ' in (substring(start_datetime FROM POSITION(':' IN
start_datetime)-3) )) =2 then
SUBSTRING(start_datetime FROM 1 FOR POSITION(':' IN start_datetime)-3)||'
0'|| SUBSTRING(start_datetime FROM POSITION(':' IN start_datetime)-1) else
start_datetime end
)AS timestamp(0) FORMAT 'MM-DD-YYYYBHH:MI:SSBT') AS timestamp(0) FORMAT
'YYYY-MM-DDBHH:MI:SSBT')
Regards,
John
|