How to search an Access database text field for a substring
I have looked through several pages and not been able to find what I need.
What I found has gotten me something that "works" but not the way I want
it to.
SELECT p.ProductName, p.QuantityPerUnit, s.CompanyName, c.CategoryName
FROM Products AS p, Suppliers AS s, Categories AS c WHERE
p.QuantityPerUnit LIKE "" & [500 g] & "" AND p.SupplierID = s.SupplierID
AND p.CategoryID = c.CategoryID ORDER BY p.ProductName;
When I run this on the Access DB a window pops up for text to be entered.
It has 500 g as the label. If I put 500 g in the text field, the query
works. What I want is to be able to run the query using 500 g as the
substring to find with out user interaction. I know I am close but am
unsure what is incorrect.
No comments:
Post a Comment