Viewing 2 posts - 1 through 2 (of 2 total)
This will pad out any column or variable to what ever length you need.
CONVERT(varchar(5), REPLICATE('0', 5 - DATALENGTH(CONVERT(varchar(5), ColA))) + CONVERT(varchar(5), ColA))
December 7, 2004 at 7:29 am
#532825
I tried Hoo-t suggestion and code and it worked like a champ. Thanks for the info.
September 21, 2004 at 7:44 am
#523811