I am attempting to subtract two dates and get a integer
value in return. I have seem to hit a roadblock since one of the two dates is null which subsequently returns an error. Is there any workaround to this, I covet to get the aging_date instead if the review_date is null.
select to_date(sysdate)aging_date,to_char(review_date,'MM/DD/YYYY')review_date
from mytable
aging_date review_date
2/26/2020 01/05/2020
2/26/2020 05/15/2018
2/26/2020
2/26/2020 03/14/2019
2/26/2020 12/17/2019
select aging_date,review_date,(aging_date - review_date)actual_date from
(
select
to_date(sysdate)aging_date,to_char(review_date,'MM/DD/YYYY')review_date,
(aging_date - review_date)actual_date from mytable
)new
ORA 01722: Invalid Number