-
challenge!
Hi!
Here is a challenge:
How would I query a field in one select statement that gives me the following fixed format everytime for every row.
for example the field value is 123 and it is an 8 character field. How can I get 00000123. All I know is the field length is always 8 but the numbers can be anywhere from 1 digit to 8 digits and I need to pad the string with leading zeroes to make sure length is always 8.
Thanks
-
You can pad zeroes and use RIGHT function like
select right('00000000'+ltrim(rtrim(extension)),8) from employees
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|