Padding an integer value...?  
Author Message
Irishjohn





PostPosted: Thu Oct 30 10:24:02 CST 2003 Top

SQL Server Developer >> Padding an integer value...?

can i pad an integer value with 0's so it's like 0001 for
instance... and if i cast it to a string the Lpad does
not seem to work on a variable...

I'm using SQL server 2000....

Here is a few things i tried...
Declare
@testint int,
@testchar char(4)








Tim

SQL Server230  
 
 
Aaron





PostPosted: Thu Oct 30 10:24:02 CST 2003 Top

SQL Server Developer >> Padding an integer value...? http://www.aspfaq.com/2300







> can i pad an integer value with 0's so it's like 0001 for
> instance... and if i cast it to a string the Lpad does
> not seem to work on a variable...
>
> I'm using SQL server 2000....
>
> Here is a few things i tried...
> Declare


>
>



>
>
>
> Tim


 
 
Daniel





PostPosted: Thu Oct 30 10:27:42 CST 2003 Top

SQL Server Developer >> Padding an integer value...? Try using VARCHAR instead of CHAR.



> can i pad an integer value with 0's so it's like 0001 for
> instance... and if i cast it to a string the Lpad does
> not seem to work on a variable...
>
> I'm using SQL server 2000....
>
> Here is a few things i tried...
> Declare


>
>



>
> Tim


 
 
Adam





PostPosted: Thu Oct 30 10:35:48 CST 2003 Top

SQL Server Developer >> Padding an integer value...? What's LPAD?

Try something like:









> can i pad an integer value with 0's so it's like 0001 for
> instance... and if i cast it to a string the Lpad does
> not seem to work on a variable...
>
> I'm using SQL server 2000....
>
> Here is a few things i tried...
> Declare


>
>



>
>
>
> Tim