Skip to Main Content

Oracle Database Discussions

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!

Compare date to number

858145Apr 27 2011 — edited Apr 27 2011
Hi, I am working with the following SQL statement and can't seem to get the syntax correct:

idSelectQuery=Select "numberprgn" from "SMT1"."CM3R1M1" where "category" != 'KM Document' AND ("sysmodtime" - TO_DATE('1970-01-01', 'YYYY-MM-DD')) * 86400000 > ?

Where the '?' is the current system time as a number - which is actually epoch time.

This statement fails because of: ORA-00932: inconsistent datatypes: expected NUMBER got DATE

I need to be able to compare the sysmodtime to the ? time value, although I can't figure out a way to properly do this... I'm not sure if i can cast sysmodtime to char then to number, because I know its not possible to cast date to number directly.

Anyone have any suggestions to get this to work?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2011
Added on Apr 27 2011
20 comments
1,868 views