February 13, 200818 yr Hi everyone, If it weren't for one condition this would be a pretty easy script for me. But alas, because of the condition I have no idea how to do this or even if it is possible. I have a text field where ID numbers will have a suffix of sm, md, lg or no suffix at all. ex 123456789sm. 123456789md, 123456789lg, 123456789. What I want to do is create a new field that will capture the suffix information. I need to write a script to pull the last two charecters of the ID number and place them in the new field but only if the last two charecters are letters and not numbers. This is a classic example of where I should have created the DB with two fields and then used a calculation to combine into one ID number but the need to do this developed long after the soltuion was developed and users started adding the suffix on their own. Now I need to go back and fix the mess. I did not anticipate this. Any help would be greatly appreciated. Thanks, Steve
February 13, 200818 yr Right (YourField; 2) or maybe Filter (YourField; "abcdefghijklmnopqrstuvwxyz) Using the SetField ( for either of these should do it) Lee
February 13, 200818 yr In your new field a simple Replace Field Contents by Calc = Filter( Right (OldField; 2) "smdlg") then in your old Field, Replace Field Contents = Left(oldField; Length(oldField)-2) & Filter( Right(OldField);2) ; "0123456789")
Create an account or sign in to comment