title: Add apostrophe to last name search
body: <p>I created a proc that will return a list of applicants by lastname. I have a problem searching Applicants with last name that has apostrophe (Example O'Connor). Could you please help finding those applicants:</p>
  
  <p>Below is my Search Code:</p>
  
  <pre><code>if Rtrim(@FirstName) &lt;&gt; ''
  begin 
    If(Len(@FirstName) &lt; 30) and (CharIndex('%', @FirstName) = 0) and @FirstName != ''
           Set @FirstName = char(39) + @FirstName + '%' + char(39)
  end 
  
  if Rtrim(@LastName) &lt;&gt; ''
  begin 
     If(Len(@LastName) &lt; 60) and (CharIndex('%', @LastName) = 0) and @LastName != ''
       Set @LastName = Char(39) + @LastName + '%' + char(39)
  end 
  
  #At the end  - --Now build dinamically the filter base on input parameters
  if Rtrim(@FirstName) &lt;&gt; ''
      select @Where = @Where + ' and a.FirstName like '+ Rtrim(@FirstName) 
  
  if Rtrim(@LastName) &lt;&gt; ''
    select @Where = @Where + ' and a.LastName like '+ Rtrim(@LastName)
  </code></pre>