title: what to do get a two digit number by using datepart () in sql?
body: <p>I am trying to use <code>DatePart</code> to return a two digit hour. I would like to see <code>01, 02, 03, ...10, 11, 12</code> for the hours. How can I do this?  </p>
  
  <p>if I entered query as,</p>
  
  <pre><code>select DATEPART(hour,'1900-01-01 07:45:00.010')
  </code></pre>
  
  <p>then I am getting answer <code>7</code>. I need to get answer as <code>07</code>.</p>