title: Trim SQL field and use ISNULL
body: <p>fairly new to SQL and having problems with trimming the data when using in an <code>ISNULL</code> statement</p>
  
  <pre><code>LTRIM(RTRIM(CA.CUSTNMBR)) as AccountNumber
  </code></pre>
  
  <p>The above gives me the account number without spaces (correct)</p>
  
  <pre><code>,ISNULL(NAN.SageAccountNo, LTRIM(RTRIM(CA.CUSTNMBR))) AS AccountNumber
  </code></pre>
  
  <p>I then tried to use the same principle in the above <code>ISNULL</code> statement but it returns the correct column but doesn't trim the data.</p>