Post Author: leongcy23
CA Forum: Formula
Dear forums buddy,
I got a situation here where I need to extract out the 1122 from the Ref note 1006;INV1122;SRNO1236. Now it will be easy if the length for the first few integer is fix. Mid (Cal.Ref, 9, 4)
But now my problem is that the 1006 sometimes will be in 2 or 3 character only. So its hard for me to extract it.
So do anyone have any idea on this? Need help here. Thanks
Anson
Post Author: SKodidine
CA Forum: Formula
I am not sure when you mention "extract out" if you wanted the string minus 1122 or just want the 1122.
If you want the string minus 1122 here is what you do.
stringvar x := '1006;INV1122;SRNO1236';stringvar y := '1122';
mid(x,1,(instr(x,y)-1)) & mid(x,(instr(x,y)+4),len(x));
If you want the 1122 alone then do this:
mid(x,(instr(x,y)),4);
replace x with the table field.
Post Author: leongcy23
CA Forum: Formula
Dear Charliy,
There is no others constant value other than the first 4 digit. The integer before first semicolon is amount ($), so its will change always. Whereby integer after first semicolon and second semicolon is code, so the length is fix.
Yes, there's always 3 letther after the first semicolon.
Yes, the target no. always precede the second semicolon
Thanks
Anson
Post Author: Charliy
CA Forum: Formula
mid(split({cal.ref),':',[2]),4,4)
You might have to tune it a little, but the Split gives you what comes after the first semicolon, then the Mid gives you 4 characters starting at the 4th character.
Add a comment