Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 29 Apr 2008 @ 22:37:54 GMT


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


Subj:   Re: Case Statement and Crystal Reports
 
From:   Fred W Pluebell

The result of a CASE expression must be a scalar value; it can't be used to select which of two conditional expressions to apply. But you can evaluate different expressions within each WHEN/ELSE alternative, something like this:

     {WHERE}
     (case when (extract(day from current_date)) = 1 then
     CASE WHEN
     (SNPSHT_DT between (add_months((current_date-
     extract(day from current_date)+1),-1)) and (current_date -
     extract(day from current_date)))
     THEN 'T' ELSE 'F' END
       Else
     CASE WHEN
     (SNPSHT_DT >(current_date - extract(day from
     current_date)))
     THEN 'T' ELSE 'F' END
       end)
     ='T'


     
  <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