Dear All I am trying to trim a text from 2 fields to create a new variable: FederalID = 123456789 BankID = B777 NewValue = 456789777 (6 RIGHT characters from FederalID + 3 RIGHT characters from BankID) I can’t get PADSTR work for me , so please help
Use COPYSTR(String,Position,Length). All you need to do is figure out the length of the string (STRLEN), the starting position (STRLEN - x) and you can cut the last x characters off of the string. Do that with both your variables and then just add them together (NewValue = String1 + String2).
quote:
Dear All I am trying to trim a text from 2 fields to create a new variable: FederalID = 123456789 BankID = B777 NewValue = 456789777 (6 RIGHT characters from FederalID + 3 RIGHT characters from BankID) I can’t get PADSTR work for me , so please help
Originally posted by Denis Petrov - 2005 Jul 12 : 18:13:03
NewValue := COPYSTR(FederalID,STRLEN(FederalID) - 6) + COPYSTR(BankID,STRLEN(BankID) - 3);
thank you all it works awesome