Timestamp calculation from Oracle to Teradata

Database
Enthusiast

Timestamp calculation from Oracle to Teradata

Hi,

Please let me know how to convert the following Oracle statement to Teradata

select To_Date('date in string','mm/dd/yyyy hh24:mi:ss') - 0.0005

Regards,
JMM
1 REPLY
Junior Contributor

Re: Timestamp calculation from Oracle to Teradata

Hi Joe,
this substracts 43.2 seconds from that timestamp-string:
1 = 1 day ->
0.0005 = 1/2000 of a day = 0.0005 * 86400

This calculation works for < 10000 days:
SELECT
'11/23/2007 11:11:55' AS ts_char,
(ts_char (TIMESTAMP, FORMAT 'mm/dd/yyyyBhh:mi:ss')) -
((86400 * 0.0005) * INTERVAL '0000 00:00:01.00' DAY TO SECOND)
;

Dieter