title: Using Case to match strings in sql server?
body: <p>I am trying to use <code>CASE</code> in a SQL Select statement that will allow me to get results where I can utilize the length of one string to produce the resutls of another string. These are for non-matched records from two data sets that share a common ID, but variant Data Source. </p>
  
  <p>Case statement is below:</p>
  
  <pre><code>Select Column1, Column2, 
  Case
  When Column1 = 'Something" and Len(Column2) = '35' Then Column1 = "Something Else" and substring(Column2, 1, 35)
  End as Column3
  From  dbo.xxx
  </code></pre>
  
  <p>When I run it I get the following error:</p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Line 5 Incorrect syntax near '='.</p>
  </blockquote>