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)
- How can I modify a saved Microsoft Access 2007 or 2010 Import Specification? +31 (2008)
- OleDbCommand parameters order and priority +28 (2009)
- Is there an equivalent to the SUBSTRING function in MS Access SQL? +26 (2009)
- What do I need to read Microsoft Access databases using Python? +25 (2009)
- MS Access library for python +24 (2009)
- is there any replacement of Access? +21 (2009)
ms-access solutions on this site
.