A client's database has tables Order Details and Products.
Part of the later code includes this
Code:
SELECT COUNT(OrderDetailID) as NotAllocated FROM [Order Details] od LEFT JOIN [Products] pd ON od.ProductID = pd.ProductID WHERE od.CasksAssigned < od.Quantity AND OrderID = OrderID AND pd.CaskType <> 'UU'
To try to see what's going on I copied this to the SQL window of a new query. Its Design View shows two new tables od and pd that are exactly like Order Details and Products.
What is happening?