all groups > sql server programming > july 2004 >
You're in the

sql server programming

group:

Looking for Str zero padded function


Looking for Str zero padded function Craig Kenisston
7/24/2004 11:13:13 PM
sql server programming:

Hi,

Is there any function that works like "Str" to convert a number to a string
representation but padding the left with zeros up to the given length ?

Thanks,

Re: Looking for Str zero padded function Aaron [SQL Server MVP]
7/25/2004 7:06:00 AM
http://www.aspfaq.com/2300

--
http://www.aspfaq.com/
(Reverse address to reply.)





[quoted text, click to view]

Re: Looking for Str zero padded function Mischa Sandberg
7/25/2004 7:36:17 AM
For non-negative numbers:
select right(replicate('0',9) + cast(NumField as varchar),9)
[quoted text, click to view]

AddThis Social Bookmark Button