Question of the day:
I have a custom dialog box (form) that prompts for criteria, then opens my report based on the specified criteria (Begin date, end date, and ProductName) It is working fine, and the query behind my report is:
SELECT DISTINCTROW ProductsUsedbyDateQuery.ProductName, Sum(ProductsUsedbyDateQuery.Quantity) AS SumQuantity
FROM ProductsUsedbyDateQuery
WHERE (((ProductsUsedbyDateQuery.OrderDate)>=[forms]![DateRangeForm]![BeginDate] And (ProductsUsedbyDateQuery.OrderDate)<=[forms]![DateRangeForm]![EndDate]))
GROUP BY ProductsUsedbyDateQuery.ProductName
HAVING (((ProductsUsedbyDateQuery.ProductName)=[Forms]![DateRangeForm]![ProductName]));
However, I want the user to be able to enter a partial name. I've tried adding the Like clause many different times, and keep getting the syntax error. I got this to work fine in a query using the WHERE clause instead of the HAVING. ??????
I have a custom dialog box (form) that prompts for criteria, then opens my report based on the specified criteria (Begin date, end date, and ProductName) It is working fine, and the query behind my report is:
SELECT DISTINCTROW ProductsUsedbyDateQuery.ProductName, Sum(ProductsUsedbyDateQuery.Quantity) AS SumQuantity
FROM ProductsUsedbyDateQuery
WHERE (((ProductsUsedbyDateQuery.OrderDate)>=[forms]![DateRangeForm]![BeginDate] And (ProductsUsedbyDateQuery.OrderDate)<=[forms]![DateRangeForm]![EndDate]))
GROUP BY ProductsUsedbyDateQuery.ProductName
HAVING (((ProductsUsedbyDateQuery.ProductName)=[Forms]![DateRangeForm]![ProductName]));
However, I want the user to be able to enter a partial name. I've tried adding the Like clause many different times, and keep getting the syntax error. I got this to work fine in a query using the WHERE clause instead of the HAVING. ??????