title: T-SQL String Functions: difference between using Left/Right and Substring and strange behaviour
body: <p>I am using SQL Server 2008 &amp; 2005 (Express). I'm trying to extract part of an alpha numeric string from a varchar field. </p>
  
  <p><code>RIGHT(str_field, 3)</code> yields null values but <code>SUBSTRING(str_field, LEN(str_field)-2, LEN(str_field))</code> gives the right value. <code>LEFT(str_field, 7)</code> gives the expected values.  What gives? </p>
  
  <p>I would have thought that <code>RIGHT(str_field, 3)</code> and <code>SUBSTRING(str_field, LEN(str_field)-2, LEN(str_field))</code> are equivalent expressions.</p>