Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 21 Dec 2004 @ 05:06:16 GMT


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


Subj:   Re: Interval in a where clause
 
From:   Michael Larkins

Simon:

The database has to do your math before it can compare the result to determine how it compares to 7. This is what my grandfather use to say as the horse is already out of the barn and it is too late to close the door now...lol

If you need (for some reason) to use INTERVAL math, you will need a compound interval such as DAY(4) to HR(4) or maybe day to minute depending on the time spans between your start and end dates.

Otherwise, you are running on Teradata now and you can bag the interval stuff in your WHERE clause:

     WHERE EndDateTime - StartDatetime <= 7

Granted this is not an interval as much as it is an integer that represents and interval of a number of days. Plus, you will not receive an error when it is greater than 9999 days.


Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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