title: Replace always replacing null values
body: <p>Why does</p>
  
  <pre><code>left(FIELD, replace(nullif(charindex('-', FIELD), 0), null, len(FIELD)))
  </code></pre>
  
  <p>always return null? The idea behind the query is that if charindex() returns 0, then convert the results into null, then convert the null into the length of the field. So if '-' does not exist, show the whole string. For some reason it makes every row equal null.</p>
  
  <p>Thank you.</p>