title: Adding leading zeros to result from substring in SQL Server 2008
body: <p>I have a substring which pulls the data I need but I need to add a leading zero to the front of the result. I've searched and found several samples of pulling data with leading zeros but none using a substring. I can add the zero to the end of the result but do not know how to add it to the front. The substring I am using is shown below.
  "substring((substring(convert(char(6),Convert(int,a.nor_ppd_hrs_no*100) + 100000),3,4) +    space(16)),1,16) as 'ApprovedHrs',"
  This produces a result like this 7500 and I need it to look like this 07500.</p>
  
  <p>Thanks</p>