In SQL statement, what do I do if I want to
1.check a variable if it's 0
2. if it is, set it to 0
SELECT tblInventoryTransaction.ProductID, Sum(tblInventoryTransaction.UnitsReceived)-Sum(tblInventoryTransaction.UnitsSold)-Sum(tblInventoryTransaction.UnitsShrinkage) AS OnHand, Sum([UnitsOrdered])-Sum([UnitsReceived]) AS [On Order]
FROM tblInventoryTransaction
WHERE (((tblInventoryTransaction.cancell)=No))
GROUP BY tblInventoryTransaction.ProductID;
If [On Hand] is less than 0, then I want to set it to 0
1.check a variable if it's 0
2. if it is, set it to 0
SELECT tblInventoryTransaction.ProductID, Sum(tblInventoryTransaction.UnitsReceived)-Sum(tblInventoryTransaction.UnitsSold)-Sum(tblInventoryTransaction.UnitsShrinkage) AS OnHand, Sum([UnitsOrdered])-Sum([UnitsReceived]) AS [On Order]
FROM tblInventoryTransaction
WHERE (((tblInventoryTransaction.cancell)=No))
GROUP BY tblInventoryTransaction.ProductID;
If [On Hand] is less than 0, then I want to set it to 0