Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 08 Sep 2009 @ 15:03:56 GMT


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


Subj:   Re: Using a case Statement in a where clause
 
From:   cblake

I'm not sure I'm following you exactly, but it sounds like this might work for you:

     select *
     from Loan
     inner join (
             select case when day_of_week = 2 then calendar_date - 3 else calendar_date - 1
     end as minDate
             , calendar_date - 1 as maxDate
             from sys_calendar.calendar
             where calendar_date = current_date
     ) c
     on Loan.Application_date between c.minDate and c.maxDate

- Chris



     
  <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