title: cast an integer converted to varchar and appended with a string to a datetime
body: <p>I can't figure out why this sql code snippet does not work:</p>
  
  <pre><code>cast(cast(b.remodelyear as varchar(5)) + '-01-01' as datetime)
  </code></pre>
  
  <p>Remodel year is an integer consisting of a year (ex: 2012).  I cast it to varchar and append a month and a day to it and then I cast the whole thing to a datetime.</p>
  
  <p>This one works:  </p>
  
  <p><code>cast(cast(Yr as varchar(5)) + '-' + cast(Mth as varchar(5)) + '-' + '01' as datetime)</code></p>
  
  <p>Where did I go wrong?</p>
  
  <p>Thanks!</p>