Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Decode date compared with sysdate and return result possible

bentonAug 31 2009 — edited Aug 31 2009
Hello,

I would like to create an expression that compares a date field with the sysdate and then categorises it with decode, this is what I have attempted so far but it throughs a right parenthesis error.
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 31 16:51:21 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> SELECT DECODE((date_expired < sysdate), date_expired, 'CURRENT')
  2    FROM tablename
  3  /
SELECT DECODE((date_expired < sysdate), date_expired, 'CURRENT')
                            *
ERROR at line 1:
ORA-00907: missing right parenthesis

SQL>
The error corresponds with column 28 which is between date_expired and <.

Thank You
Ben
This post has been answered by Rob van Wijk on Aug 31 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2009
Added on Aug 31 2009
8 comments
16,097 views