I recently discovered that the WORKDAYS_BETWEEN function has an unexpected handling of null values as it returns 0 if both dates are null.
Select WORKDAYS_BETWEEN('01',null,null) FROM DUMMYReturns 0.
In contrast
Select SECONDS_BETWEEN(null,null) FROM DUMMY
and
Select DAYS_BETWEEN(null,null) FROM DUMMY
return null.
Even more the WORKDAYS_BETWEEN function returns null if only one of the two dates is null. This behavior should be corrected as it
is inconsistent and makes things complicated when calculating averages.