I have a query that counts the price of all items between two dates. Here is the select statement:
SELECT SUM(Price) AS TotalPrice
FROM Inventory
WHERE (DateAdd
Edit: Looks like everyone else beat me to it haha
Found the answer.
ISNULL() determines what to do when you have a null value.
In this case my function returns a null value so I needed specify a 0 to be returned instead.
SELECT ISNULL(SUM(Price), 0) AS TotalPrice
FROM Inventory
WHERE (DateAdded
BETWEEN @StartDate AND @EndDate)