title: Add leading zeros to a varchar field
body: <p>I have a field that is <code>varchar(8)</code>, holding date values that I converted from <code>float</code> to <code>varchar</code>.  </p>
  
  <p>Some records have eight characters, and some have seven.  I would like to make them all the same length by adding a leading zero to the ones that have 7. </p>
  
  <ul>
  <li><p>8 char example: 12162003</p></li>
  <li><p>7 char example: 5072004 (needs a leading zero)</p></li>
  </ul>
  
  <p>The query:   </p>
  
  <pre><code>select birthdate_new from table_name 
  </code></pre>