Home Page for the TeradataForum

Archives of the TeradataForum

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

  <Prev Next>  
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

         ,(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


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