Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to prevent user select start date bigger than end date in date picker calender?

I have 2 date picker calendar start date and end date
How can I check and compare when the user select end date must be bigger than start date in oracle apex ?

How to use validation and prevent user select start date bigger than end date
like this code example :

if (:P5_START_DATE > :P5_END_DATE) THEN return error "Start date must be less than end date"

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Items are treated as strings, so you’ll have to convert them to date datatype values, and then do the comparison.

Create validation that returns error text as e.g.

if to_date(:P5_START_DATE, 'dd/mm/yyyy') > to_date(:P5_END_DATE, 'dd/mm/yyyy') then
   return 'Start date must be less than end date';
end if;

Mind the quotes! Your example shows you used double ones; that won’t work in Oracle – strings are enclosed into single quotes.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading