How do I create parameter query to search for part of input word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to be able to have the user input a part of a word and find all
matches. For example:
[Enter PART of a Company Name]
if they enter: amer
I want all comapanies that start with amer
 
WHERE [Company Name] LIKE [Enter PART of a Company Name] & "*"

This will get only the companies having names that START with what is
entered by the user. If what they type is anywhere else in the field, they
won't see it.
 
For that use Like in the select query

SQL that return all the companies starts with a word enter by the user
Select * From MyTable Where MyField Like [Enter A Name:] & "*"

SQL that return all the companies Ends with a word enter by the user
Select * From MyTable Where MyField Like "*" & [Enter A Name:]

SQL that return all the companies That includes the string entered by the user
Select * From MyTable Where MyField Like "*" & [Enter A Name:] & "*"
 
Back
Top