Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding zero to single digit number

Status
Not open for further replies.

jfgonzalez

Technical User
Apr 16, 2002
36
US
I've looked in all the available resources and I can't find the solution for what seems to be a simple command -- how to add a '0' before a single digit number (i.e., 01, 02, 03, etc).

I've tried various cast and convert commands but get numerous errors. This is really driving me insane.
 
Code:
SELECT '0' + CONVERT(varchar(1), int_value)
--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top