Last post Apr 25, 2018 09:31 AM by Deepak Panchal
Apr 24, 2018 05:15 PM|yzidell|LINK
here is my query which works:
SELECT GiftRegistryCustomerSelectedItemID, Quantity AS QtyReq,
(SELECT SUM(tblGiftRegistryOrderItems.Quantity) AS Expr1
FROM tblGiftRegistryOrders LEFT OUTER JOIN
tblGiftRegistryOrderItems ON tblGiftRegistryOrders.GiftRegistryOrderID = tblGiftRegistryOrderItems.GiftRegistryOrderID
GROUP BY tblGiftRegistryOrders.BuyStatus, tblGiftRegistryOrderItems.GiftRegistryCustomerSelectedItemID
HAVING (tblGiftRegistryOrders.BuyStatus = 'Sold') AND
(tblGiftRegistryOrderItems.GiftRegistryCustomerSelectedItemID = viewGiftRegistryCustomerSelectedItems.GiftRegistryCustomerSelectedItemID))
WHERE (GiftRegistryCustomerSelectedItemID > '0') AND (EventID = '182')
ORDER BY QtyPurch, QtyReq
the issue is when i put AND (QtyReq > QtyPurch) into the where clause it says "invalid column name QtyReq"
thx for ur help
Apr 25, 2018 09:19 AM|rajesh93180|LINK
In your SQL query, QtyReq is an alias name for the actual field
Quantity. So use Quantity in Where clause instead of QtyReq.
Apr 25, 2018 09:31 AM|Deepak Panchal|LINK
Did you try to directly use the field name that is "Quantity"?
If you did not check it before then you can try it and let us know about the result.
try to declare field with table name and check whether it helps to solve the issue.