Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Difference between Timestamp - response (3) by dlabar

$
0
0

 

What can you do if there are more than 9999 days between the timestamps?  I am trying to get the number of seconds elapsed (ideally as decimal rather than interval).  For instance, this gives an error:

 

SELECT

CURRENT_TIMESTAMP AS t2,

(t2 - INTERVAL '9999' DAY - INTERVAL '30' DAY) t1,

(t2 - t1) DAY(4) TO SECOND delta

 

I can write a case statement that returns results only when the difference is between +/-9999 days, but when the difference is outside this range, it can only return null.  I would like to get the number of seconds for these cases.
 


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>