I have the following query:
SELECT[OrderID],[OrderDate],[ProductID],[ProductName],[Quantity]
FROM[UnionQuery1]
WHERE (OrderDate Between [Enter begin date:] And [Enter end date:]) AND ProductName LIKE "*" & [Enter Product Name:] & "*"
UNION SELECT[OrderID],[OrderDate],[ProductID],[ProductName],[Quantity]
FROM[UnionQuery2]
WHERE (OrderDate Between [Enter begin date:] And [Enter end date:]) AND ProductName LIKE "*" & [Enter Product Name:] & "*";
I need to SUM the Quantity field. I've tried many different ways to do this, but keep getting the error: "You tried to execute a query that does not include the specified expression "OrderID" as part of an aggregate function."
Can anyone tell me what I'm doing wrong??
Thanks!!!!!!
SELECT[OrderID],[OrderDate],[ProductID],[ProductName],[Quantity]
FROM[UnionQuery1]
WHERE (OrderDate Between [Enter begin date:] And [Enter end date:]) AND ProductName LIKE "*" & [Enter Product Name:] & "*"
UNION SELECT[OrderID],[OrderDate],[ProductID],[ProductName],[Quantity]
FROM[UnionQuery2]
WHERE (OrderDate Between [Enter begin date:] And [Enter end date:]) AND ProductName LIKE "*" & [Enter Product Name:] & "*";
I need to SUM the Quantity field. I've tried many different ways to do this, but keep getting the error: "You tried to execute a query that does not include the specified expression "OrderID" as part of an aggregate function."
Can anyone tell me what I'm doing wrong??
Thanks!!!!!!