Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 17 Jun 2004 @ 22:43:52 GMT

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

Subj:   Re: Calculating Minutes between Timestamps
From:   Maxwell, Donald

     SELECT  CAST( CAST( (T2 - T1 DAY(4) TO SECOND) / 86400
                AS INTERVAL SECOND(4,6) ) AS DECIMAL(10,6) ) * 1440

T2 and T1 are your timestamps. 86400 is the number of seconds in a day. 1440 is the number of minutes in a day. The answer datatype is DECIMAL(15,6). You can choose to round or truncate the fractional minute component.

Donald Maxwell

  <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: 23 Jun 2019