Skip to Main Content

APEX

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!

Bind variables and date format questions

indy2005Sep 14 2016 — edited Sep 16 2016

Hi,

If I retrieve 2 date values into page items from a database, are the page item bind variables in the date format?

I ask because I need to do this:

IF trunc(TO_DATE(:P5_NEXT_RENEWAL_DATE,'DD-MON-YYYY')) < trunc(:P5_AS_OF_DT)

But very often I get an error unless I remove the trunc() from around the (:P5_AS_OF_DT) expression.

Both page items are text fields, and are bound to database columns which are of a DATE format.

I am concerned I am actually doing a text comparison and not a date comparison when I see trunc not working around one of the dates.

Do I always have to convert my page items to dates using TO_DATE in every PL/SQL expression I write involving dates in APEX 5.0?  Seems odd that I cant just treat a date as a date, when Oracle must know it came from a date field?

I have lots of dynamic actions which have conditions like this:

:P5_RENEWAL_REQUIRED = 'Yes' AND :P5_NEXT_RENEWAL_DATE > :P5_AS_OF_DT

My concern is I am doing a text comparison and not a date comparison.

Regards

SM

This post has been answered by fac586 on Sep 14 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 14 2016
Added on Sep 14 2016
12 comments
2,433 views