Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 06 Mar 2009 @ 16:53:33 GMT


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


Subj:   Re: Which part of the year
 
From:   Lunn, Jonathan

I'd be inclined to use the system calendar table, like this:

     SEL day_of_year
     ,   ((year_of_calendar * 10000) + 1231 (DATE)) - ((year_of_calendar * 10000)
     + 0101 (DATE)) + 1 (NAMED days_in_year)
     ,   (CAST(day_of_year AS FLOAT) / CAST(days_in_year AS FLOAT)) * 100
     (DECIMAL(15,12))(NAMED complete_pct)
     FROM sys_calendar.calendar
     WHERE calendar_date = DATE;

JL



     
  <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