title: SQL Server add leading zero to single digit month
body: <p>I'm trying to add a leading zero to months where there is only a single digit (everything before October).  Here's my code:</p>
  
  <pre><code>with tab1 as (
      select month(CommitDate) monCommDt
              , year(CommitDate) yrCommDt
      from myTable
  
  )
  
  select CASE WHEN LEN(monCommDt) = 1
              THEN CONCAT('0', monCommDt)
              ELSE monCommDt
              END lzCommDt
          , yrCommDt
          , LEN(monCommDt) lenCommDt
  from tab1
  </code></pre>
  
  <p>Here's the output:</p>
  
  <pre><code>lzCommDt    yrCommDt    lenCommDt
  7   2013    1
  7   2013    1
  7   2013    1
  7   2013    1
  </code></pre>
  
  <p>Any idea why the leading 0 isn't being added?</p>