-
Decode
Hi,
How can i use Decode function
I have columns Start_Date and End_date.
If End_Date is > Start_Date, i want to substitute with the SYSDATE.
I am using DECODE function, but getting errors...
Select START_DATE,
decode(END_DATE,(END_DATE>SYSDATE),sysdate,END_DATE)
FROM
Date_Table where TECH_NO=64783;
I am getting paranthesis error....
Can i use > and less than symbol in DECODE ???
Regards
Sonia
-
You need to use case:
Select
Case
When END_DATE>SYSDATE Then SYSDATE
Else END_DATE
End
From . . . .
P.S. you can do it with decode & sign(END_DATE-SYSDATE)
Last edited by DaPi; 01-12-2004 at 09:55 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|