Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 31 Jul 2003 @ 21:02:51 GMT


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


Subj:   Re: ISO DATE question
 
From:   Hough, David A

You might try this:

select
date,
extract(year from date)*100+
(((((date - date '2002-12-30')(integer)) / 7) (integer)) mod 52)+1 as ISOVAL

The date literal (2002-12-30) anchors the equation to the first day of any ISO year, and must predate any date value you want to convert.

It works over the range of values I tested, but test thoroughly. ;)

/dave



     
  <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