|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 6/10/2009 5:41:44 AM
Posts: 1,
Visits: 5
|
|
Hi
I have the requirement in my project, i need to pad the leading zeros to the account number. to make the account number length equal to 10+ one space at first place.
Condition Source Value Source Value Result
CLNT_I 0000000123
CLNT_I=10(without sign) 1234567890 1234567890
CLNT_I 0000000123
CLNT_I=10 (with sign) -1234567890 - 1234567890
Please let me know the function.
Thanks,
Manj
Thanks,
Manju
|
|
|
|
|
Supreme Being
      
Group: PAC and SFT Members
Last Login: 9/9/2009 4:34:06 PM
Posts: 407,
Visits: 889
|
|
|
CAST(CAST(CLNT_I AS FORMAT'-9(10)') AS CHAR(11))
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 10/28/2009 2:45:46 PM
Posts: 1,
Visits: 15
|
|
I have two fields that I need to pad leading zeros. One requires 12 digits with pad leading zeros, such as 001123456789. The other requires 10 digits with pad leading zeros, but last two are decimals, such as 000001000. Here is my line of code. I can't tweak the code in the first line to work for 12-digit. when I changed from '9(10)' to '12(13)' I got invalid error message. The second line of code did not return pad leading zeros. What is wrong here.
CAST(CAST(acct_id '9(10)') AS CHAR(12)) ,
amt_due (decimal(11,2), format '$$$,$$$,$$9.99')
Thanks for any helps!
Sabrina
|
|
|
|