0
votes

I need to write a validation statement for Start and End Date.

These are the logic I need to implement:

  • Start Date should be equal to current date or future date.
  • End Date should be equal to start date or greater than start date.

I have two columns in the database named START_DATE and END_DATE. I have two columns in Apex named 'P1_START' and 'P1_END'

I am no sure how to get started on typing out the function as I am new at querying. Any detailed suggestions would be great.

1

1 Answers

2
votes

You could choose a PL/SQL validation, and use

to_date(:p1_start) <= to_date(:p1_end)

We explicitly convert the bind variables as they are all stored as strings. Without supplying the format, it will use the application globalisation settings.