I'm using Microsoft SQL Server 2012 and keep running into the error
Divide by zero error encountered.
for the statement like below. I want to add a null if the two dates are the same.
SELECT
sf.TotalPrice / DATEDIFF(day, sf.StartDate,sf.EndDate) as DailyAllocatedRevenue,
sf.TotalPrice
FROM
sftable