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!

Trying to compare dates in select statement to yield boolean result

707657Jun 18 2009 — edited Jun 18 2009
I'm trying to convert from MySQL to Oracle.

I have existing queries in this form:

select date_add(entered,interval 7 day) < now() as check
from user
where id = 1";

I've converted this to:

select (7+entered) < TO_DATE('2009-06-18','RRRR-MM-DD') as check
from user
where id = 1

When I run this, I get this error:

ORA-00923: FROM keyword not found where expected

If I add parens around the select,

select ( (7+entered) < TO_DATE('2009-06-18','RRRR-MM-DD') ) as check
from user
where id = 1

I get ORA-00907: Missing right parenthesis.

Thanks in advance for any assistance.

Regards,
Marty
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 16 2009
Added on Jun 18 2009
4 comments
845 views