|
|
Archives of the TeradataForum
Message Posted: Tue, 08 Sep 2009 @ 15:03:56 GMT
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
| |