kramerd1506
Technical User
Hi folks, you're all so helpful that I just had to come back.
Here's the code I'm working with:
select distinct
....
from
table a
table b
(select to_char((sysdate), 'dy') from dual) dt
where
....
AND
if dt = 'fri'
then
((a.date1 >= trunc(sysdate+1)
and a.date1 < trunc(sysdate+4))
OR
(b.date2 >= trunc(sysdate+1)
AND b.date2 < trunc(sysdate+4)))
else
((a.date1 >= trunc(sysdate+1)
and a.date1 < trunc(sysdate+2))
OR
(b.date2>= trunc(sysdate+1)
AND b.date2 < trunc(sysdate+2)))
AND
....
When I run this I get an error at "if dt = 'fri'" of Invalid Relational Operator.
Any advice? Thanks in advance, as always.
Here's the code I'm working with:
select distinct
....
from
table a
table b
(select to_char((sysdate), 'dy') from dual) dt
where
....
AND
if dt = 'fri'
then
((a.date1 >= trunc(sysdate+1)
and a.date1 < trunc(sysdate+4))
OR
(b.date2 >= trunc(sysdate+1)
AND b.date2 < trunc(sysdate+4)))
else
((a.date1 >= trunc(sysdate+1)
and a.date1 < trunc(sysdate+2))
OR
(b.date2>= trunc(sysdate+1)
AND b.date2 < trunc(sysdate+2)))
AND
....
When I run this I get an error at "if dt = 'fri'" of Invalid Relational Operator.
Any advice? Thanks in advance, as always.