Good afternoon,
I am trying to add leading zeros to a character field and want all values in the field to have a character length of 9. For example, I would like 1234B11 to be 001234B11. Is there any easy way to do this within the Equation Editor window?
Thanks!
Breanna_28
Offline
Last seen: 7 months 1 week ago
Joined: 10/24/2016 - 15:02
@compif(@len(Field)==7;"00"+Field;@len(Field)==8;"0"+Field; [...])
If you have IDEA 10.3 and above also Python could help you:
1) Make a new script fill.py and save it in the library as user defined function.
def fill(param):
return param.zfill(9)
2) append a new char field with the following equation:
@python("fill"; FIELD)
Hi Breanna,
@Right( @Repeat( "0" ; 9 ) + @Alltrim(FIELD) ; 9 )
will also solve Your problem.
Awesome! That worked for me. Thank you both for your help!