Question:
I’m still quite new to using SQL and I am designing a database in which I am cataloging resources owned by my company. I am attempting to create a query that will allow the user to enter a value such as an author’s name and have the query search the author’s field to provide all records with that author’s name. My problem is that when I set a parameter and run the query, the prompt shows up and requests that the user enter the parameter. This part is fine, however, it only works if the parameter value is exactly what was entered by the user. For example if the Authors name is John Smith, but at the prompt the user enters only Smith, no records appear. I am designing in Access.
Answer:
It sounds to me like you need the LIKE comparison operator with a “%” (percent sign) on both sides of the thing you want to test like this:
SELECT framisFROM foobarWHERE foobar.framis LIKE %SMITH%
This will retrieve Smithson, Winesmith and Smith.