I am trying to perform additional aggregated calculations on a field that I created and because some values are negative, it is messing with the averages. If the values were to be 0
, it would also mess with the averages so it's important that these negative values are treated as NULL
.
I think that I will probably need the NULLIF
calculation on top of my existing query, but the syntax doesn't seem to accept <0
and I can't find anywhere what the proper syntax would be.
SELECT
NULLIF(DATEDIFF(day,deposit_date,acceptance_date),<0) AS 'Days until Acceptance'
FROM data