Use a query's value in where statement I'm searching how to do this and can't find it.

Here's my query:

SELECT
    S_Product.Name AS "Name"
    SUM(S_Item.Quantity) AS "QtySold"
FROM s_product
INNER JOIN S_Item ON S_Product.ID = S_Item.Product_ID
WHERE "QtySold" &gt; 500 
--(SUM(S_Item.Quantity)) cannot be used in a WHERE statement since it's a group function
GROUP BY S_Product.Name


Though this doesn't work I think you get my idea, how could I use the `"QtySold" value in the WHERE statement?
The answer is to put any testing of aggregations in to a HAVING clause:

SELECT
    S_Product.Name AS "Name"
    SUM(S_Item.Quantity) AS "QtySold"
FROM s_product
INNER JOIN S_Item ON S_Product.ID = S_Item.Product_ID
GROUP BY S_Product.Name
HAVING SUM(S_Item.Quantity) &gt; 500 ;