|  |  | 
|  |  | Archives of the TeradataForumMessage Posted: Mon, 20 Dec 2004 @ 14:32:42 GMT
 
 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 
 | ||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | ||||||||||||||||||||||||||||||||||||||||||||||||
|   | ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||