Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Thu, 23 May 2002 @ 15:26:08 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Calculations with timestamps
 
From:   Jim Calvert

Michael:

Here is a working example of two dates and two times formatted into TimeStamps and then subtracted. You can probably rework it for your needs.

SELECT
(CAST(((STARTDATE(DATE, FORMAT'YYYY-MM-DD'))(CHAR(10)))||' '|| STARTTIME AS TIMESTAMP(0))
-
CAST(((ENDDATE(DATE, FORMAT'YYYY-MM-DD'))(CHAR(10)))||' '|| ENDTIME AS TIMESTAMP(0))
) HOUR(3) TO SECOND(0) AS TIMEDIFF
FROM MYDATA_TRACKING;


Watch that your ODBC driver's settings output the resulting Interval in its correct time format.

Jim Calvert - NCR



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020