I am new to Oracle and I have ran into a problem. I have a form on my page that has a START_DATE and END_DATE, and I need to compare these values to their corresponding StartDate and EndDate columns in the DB. These columns are nullable so I am erroring out. What are the different ways around this? Using ToDate is not going to work easily because I am currently using a Filter class to build my query so I was looking for other options.
Share
It’s going to depend on what kind of logic you use to handle the dates. If null for a start date means “doesn’t apply” and the same is true for end_date, then you could do something like:
That is, just plug in arbitrarily small and large values for start_date and end_date when you don’t have values.
But it depends on your specific logic as to whether the above is appropriate.