title: Add 0 at beginning in SQL
body: <p>I have small table</p>
  
  <pre><code>Create Table TestDates
  (
    TestDateId int identity (1,1),
    RunDateTime DateTime
  )
  </code></pre>
  
  <p>I manage to execute distinct query that brings only time but 
  if hour or minute is less then 10 I want to add zero</p>
  
  <pre><code>SELECT DISTINCT SUBSTRING(CONVERT(varchar, RunDateTime, 100), 13, 2) + ':'
  + SUBSTRING(CONVERT(varchar, RunDateTime, 100), 16, 2) + ' '
  + SUBSTRING(CONVERT(varchar, RunDateTime, 100), 18, 2) AS DistinctDate
  from TestDates
  </code></pre>
  
  <p>See example</p>
  
  <pre><code>**Current Output     Desired Output**
  
  8:1 PM               **08:01 PM** 
  8:33 AM              **08:33 AM**
  </code></pre>
  
  <p>I tried to use right function but it does not help</p>
  
  <pre><code>SELECT DISTINCT Right('00' + SUBSTRING(CONVERT(varchar, RunDateTime, 100), 13, 2),2) + ':'
  + Right('00' + SUBSTRING(CONVERT(varchar, RunDateTime, 100), 16, 2),2) + ' '
  + SUBSTRING(CONVERT(varchar, RunDateTime, 100), 18, 2) AS DistinctDate
  from TestDates
  </code></pre>
  
  <p>Please advice</p>