Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Fri, 02 Nov 2012 @ 20:48:37 GMT


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


Subj:   Re: Subtraction between dates
 
From:   Anomy Anom

< -- Anonymously Posted: Friday, November 02, 2012 13:39 -- >

The value '2012-02-20' isn't a date, it's a character string. The subtraction is triggering an implicit CAST to integer, attempting to do what you meant (though it would probably be better to just throw an error).

Use the proper constant format DATE'2012-02-20'.

Or explicitly CAST('2012-02-20' as DATE FORMAT 'YYYY-MM-DD').



     
  <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: 28 Jun 2020