title: How can I change NULL to 0 when getting a single value from a SQL function?
body: <p>I have a query that counts the price of all items between two dates. Here is the select statement:</p>
  
  <pre><code>SELECT SUM(Price) AS TotalPrice 
  FROM Inventory
  WHERE (DateAdded BETWEEN @StartDate AND @EndDate)
  </code></pre>
  
  <p>You can assume all of the tables have been set up properly.</p>
  
  <p>If I do a select between two dates and there are no items within that date range, the function returns NULL as the TotalPrice rather than 0.</p>
  
  <p>How can I make sure that if no records are found, 0 gets returned rather than NULL?</p>