title: Concat in not working inside case statement
body: <p>I have a month column with values from 1,2,3 up to 12. I am writing below query to convert column values with 1 digit to 2 digits that is values like 1 and 2 will be converted to 01 and 02, but that concatenation is not working, the month still remains as single digit.</p>
  <p>Main query:</p>
  <pre><code>select 
      case 
          when len(month) = 1 
              then concat(0, month) 
              else month 
      end as month_new,
      month
  from
      Table
  </code></pre>
  <p>But when I tried the query separately as below the concatenation works and it converts single digit month to 2 digits</p>
  <p>Query 1</p>
  <pre><code>select top 10 concat(0, month), month
  from table
  </code></pre>
  <p>Query 1 alone is working</p>
  <p>Query 2</p>
  <pre><code>select 
      case 
          when len(month) = 1 
              then 1 
              else 0 
      end, 
      month
  from
      Table
  </code></pre>
  <p>Query 2 alone is working, means the checking of length in column month is working as expected. But when concat used inside case it is not working.</p>
  <p>I have modified the query as below and worked for me</p>
  <pre><code>select 
      case 
          when len(month) = 1 
              then concat(0, month) 
              else cast(month as varchar)
      end as month_new,
      month
  from
      table
  </code></pre>