Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 20 Dec 2004 @ 14:32:42 GMT


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


Subj:   Interval in a where clause
 
From:   Simon Bloomer

Hi all

I'm struggling with the correct syntax for evaluating the difference between two dates (in a timestamp)

My intention is the following

     Select
         StartDateTime
         ,EndDateTime
         ,(EndDateTime - StartDatetime) DAY(4) as Difference

     From MyTable

     Where Difference <= 7

Now this returns a 5407 error which is expected because the result set is an INTERVAL

If I do the following:

     Where (Second_EntryDateTime - First_EntryDateTime) DAY (4) <= INTERVAL '7' DAY

I get the same 5407

What is the correct way to do this evaluation?


Many thanks

Simon



     
  <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: 27 Dec 2016