Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 02 Nov 2012 @ 20:46:18 GMT

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

Subj:   Re: Subtraction between dates
From:   Tewksbury, Kevin

I have always made sure to cast the hard coded dates as dates. Try this:

     Select cast('2012-02-20' as date) - cast('2012-02-10' as date)

This should give the difference in days. I am sure there are some experts out there that have a better way of doing it.


  <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