Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 03 Jul 2003 @ 01:31:03 GMT


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


Subj:   Re: Selecting the min. non-null date
 
From:   Jake Johnson

Try

select
case
        when date 1 < date 2 and date 1 < date 3 and date 1 < date 4
                then date 1
        when  date 2 < date 1 and date 2 < date 3 and date 2 < date 4
                then date 1
        when ....

This will work if your number of date columns doesn't change. You may want to try a pivot table so that if you have the number of rows X the number of date columns and then take the max of them (while grouping by each record it). I will give it some more thought. This was just my quick and dirty answer.


Regards,

Jake Johnson



     
  <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