I need to find difference between two dates to calculate "total storage days" in pgadmin
date1-date2=total storage days
The date values is having null values, if i use isnull(date1,0)
ERROR: function isnull(date, unknown) does not exist
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
If i use isnull(cast(date2 as integer),0) ERROR: cannot cast type date to integer
Please help me to calculate difference of 2 dates to find total storage date, if date field having null value also need to calculate total storage date
It calculate difference between date1 and date2 if not null both else 0