Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 15 May 2002 @ 23:46:15 GMT


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


Subj:   Re: Calculations with timestamps
 
From:   Jason Fortenberry

Michael,

You need to define the interval type you would like your difference stored as, sort of like a cast. So if you wanted to know the minutes between 2 timestamps you would code:

select (cast ('2002-05-15 00:30:00' as timestamp(0))
       - cast ('2002-05-14 22:30:00' as timestamp(0))) minute(4);

You can store the difference as day, hour, min to sec, etc. You just have to specify. See chapter 2 of SQL Reference - Volume 3 for all the available intervals.

If you need the difference in seconds, there is unfortunately not an interval for this. So let me know if you need, I have some sql that can generate this difference for you.

--Jason Fortenberry
Argosy Gaming Company



     
  <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: 15 Jun 2023