Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 02 Sep 2004 @ 10:01:04 GMT


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


Subj:   Re: Generating week dates without sys_calendar
 
From:   Victor Sokovin

Dieter,

  That's my calendar version, it includes ISO weeks and may start at any date (not only 1900-01-01)  


That's great; but if you say ISO A you should say ISO B. ISO specifications include not only weeks but also years. Compare, for example, how Oracle presents them:

     SQL> select to_char(to_date('20050102', 'YYYYMMDD'), 'YYYY-WW')
       2  from dual ;

     TO_CHAR
     -------
     2005-01

     SQL>
     SQL> select to_char(to_date('20050102', 'YYYYMMDD'), 'IYYY-IW')
       2  from dual ;

     TO_CHAR
     -------
     2004-53

If we mix ISO weeks with calendar years, then, in this example, Jan 2, 2005 will be booked on the 53-rd week of 2005. It does not even exist!

I second that it would be great to have the full ISO specs in Teradata so that we don't have to re-invent this wheel again and again.


Regards,

Victor



     
  <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