title: Access 2010 SQL Query find partial match in string of full word only
body: <p>I hope this is a simple one, I just can't find how to get the result I want, maybe I am using the wrong keyword in SQL?</p>
  
  <p>I am searching an Employee table which contains a Full Name field, this field can be "Sam" or "Mr Evans" or "Mr Sam Evans"</p>
  
  <p>I am trying to find partial matches with another Names table which contains a Name field - this is usually a short name such as "Sam" or "Evans" but could be "Sam Evans"</p>
  
  <p>I have tried like, with and without * as follows</p>
  
  <pre><code>SELECT tblEmployee.FullName, tblNames.Name
  FROM tblEmployee, tblNames
  WHERE tblEmployee.FullName Like "*" &amp; tblNames.Name &amp; "*"
  </code></pre>
  
  <p>as well as the results I do want, this query can return Employee FullName of "Mr. Samson" which I don't want. I only want to see results contaning the full word "Sam" not FullNames with Sam in part of a word within the string. So I want to see Mr. Sam Evans and Mr. Sam Smith and Ms. Sally Evans, etc.</p>
  
  <p>I hope this makes sense. Many thanks for your help </p>
  
  <h2>Edit - solution</h2>
  
  <p>I have solved this - just posting in case it might help anyone with a similar problem.</p>
  
  <pre><code>WHERE " " &amp; tblEmployee.FullName &amp; " " Like "* " &amp; tblNames.Name &amp; " *"
  </code></pre>
  
  <p>so basically by adding a space at the beginning and the end of the Employee Full Name, I catch all the correct records. I hadn't realised you could pad out a field like this but a colleague tipped me off!</p>