I have a query that I want to capture Sales for Parts. I am expecting to get the full results from the Parts table and if there are no Sales for that Part in the timeframe, I want to see a 0 in the Sales column. I am not seeing that. I am just getting the Parts that had Sales.
SELECT
Part,
Sum(Sales)
FROM
dbo.Parts
LEFT OUTER JOIN
dbo.SalesData ON Part = Part
WHERE
SalesDate > '2011-12-31'
GROUP BY
Part
ORDER BY
Part
What am I doing wrong?