Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 06 Oct 2000 @ 09:09:41 GMT

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

Subj:   Re: Functions of dates!
From:   Richard Perry


I have always found the following SQL very useful for calculating the first and last day of the previous month.

((((add_months(date,-1)/100)*100)+1) (date)),
(((date/100)*100)+1 (date)) -1

Hope it helps.

  <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: 27 Dec 2016