Page 1 of 1

Left Padding

Posted: Fri Aug 27, 2010 8:56 am
by sreddy
Hi

I have a conversion job, job is working fine. But one of the column data is not matching when compare to production.

column data type is Char ( 9 )

In my production table the data is like this

000000001
000006535
000000023
009864321

After i ran job the data is loading in this format

1
6535
23
9864321

I need to add 0's ln left side.

Will it works
Str("0",9-Len(Lnk_In.V_NUM)) : Lnk_In.V_NUM

Any one can help me to resolve... ASAP please.

Posted: Fri Aug 27, 2010 9:01 am
by nani0907
yes the logic you have mentioned will work.

bcoz you first finding the number of zeros to append and then concatenate the value

Posted: Fri Aug 27, 2010 9:08 am
by anbu
Or

Code: Select all

Right('000000000' : Trim(Lnk_In.V_NUM), 9)

Posted: Fri Aug 27, 2010 11:18 am
by sreddy
Thanks

My Logic is working fine.