SQL LIKE operator with parameters and wildcards

calendar_today Asked Dec 31, 2012
thumb_up 5 upvotes
history Updated April 16, 2026

Question posted 2012 · +6 upvotes

I have a query where I want to return all Clients that have a certain string in the name with wildcards on either side. So the input could be “Smith” and i want to return all things like “The John Smith Company” or “Smith and Bros”. I want [Client] to be prompted so I set up the SQL like this:

PARAMETERS Client Text ( 255 );
SELECT *
WHERE (((tbl_IncomingChecks.Client) Like'%' + [Client] + '%') 
ORDER BY tbl_IncomingChecks.Client;

The query is not returning any results. Please help

Accepted answer +5 upvotes

MS Access uses * as a wildcard not %, so your query will be trying to match literal ‘%’ characters. Use * instead unless you are using ADO.

http://office.microsoft.com/en-us/access-help/like-operator-HP001032253.aspx

Top ms-access Q&A (6)

+5 upvotes ranks this answer #48 out of 55 ms-access solutions on this site .