0

On APEX 5.0, I tried to add date validation in "From" date of my form to show errors on page when From date entered is today's date. On processing page I created new validation name with following settings. With below settings still the validation is not working, could you please suggest where I am doing wrong.

Type -> PL/SQL expression 2)PL/SQL expression -> to_char(to_date(:P5_NEW_8,'YYYY-MM-DD-HH24:MI:SS'),'YYYY-MM-DD-HH24:MI:SS') < to_char(sysdate,'YYYY-MM-DD-HH24:MI:SS') where P5_NEW_8 is the "From" date picker item where date entered is of format YYYY-MM-DD-HH24:MI:SS.

Error message -> From: date needs to before today

Associated Item -> P5_NEW_8

Condition -> When Button Pressed -> New_7

New_7 button has a dynamic action to display result on my bar chart.

Condition Type -> Request is contained in Value

Value -> Create, Save

4

1 回答 1

1

无需将日期转换为 varchar2,通过这样做您正在进行字符串比较,即 12-01-2010 大于 02-09-2016,而不是日期比较。

所以改用更简单的: to_date(:P5_NEW_8,'YYYY-MM-DD-HH24:MI:SS') < sysdate

于 2015-10-09T11:32:54.107 回答