jsctechy
asked on
add leading zero to a column
hi,
I have this select statement:
Select MILLAGE_CODE FROM TAX_ROLL
and this returns this:
700
1100
1840
950
950
750
2000
2000
1000
1000
2200
what i need to do is add as many leading zero as requiered to make it 5 characters long as follows:
00700
01100
01840
00950
00950
00750
02000
02000
01000
01000
02200
how can i do this?
Thanks,
jsctechy
I have this select statement:
Select MILLAGE_CODE FROM TAX_ROLL
and this returns this:
700
1100
1840
950
950
750
2000
2000
1000
1000
2200
what i need to do is add as many leading zero as requiered to make it 5 characters long as follows:
00700
01100
01840
00950
00950
00750
02000
02000
01000
01000
02200
how can i do this?
Thanks,
jsctechy
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Copy and paste was a key!
Thanks
Thanks
select right ('00000' + '500',5)
so, this should work for you
Select right ('00000' + MILLAGE_CODE,5) FROM TAX_ROLL