I have a problem with a query in Db2. I need to get the MAX value from a date value. If it is Null it should return 9999-12-31
.
Below is my query so far:
select
case
when max(cancel_dt) is null
then '9999-12-31'
else max(cancel_dt)
from table
where <conditions>