There is an alfanumeric field I want to format in the select query. The value is, for example "1234" and I want to get it as "01234" in the select process.
The ltrim(rtrim()) removes any spaces from around the field.
You are then adding a string of 0's onto the left of the field.
Then using right(,5) to truncate the field to 5 characters from the right which will leave your field padded with 0 from the left.
This will hopefully give you the result you're looking for.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.