December 20, 200718 yr I have a field named FullName from which I need to extract the last name into a separate field. I used the Calculatoin in the manual to do this when the field used the format of "FIrstName LastName" but we had to change the field to display "First Last, Title." Can anyone help with a Calc to do this? A comma always follows the last name. i.e., John Smith, MD --> Smith Thanks!
December 20, 200718 yr We just had this topic. See if this Link doesn't answer your questions. Be sure to follow any links, and download the example file(s) HTH Lee
December 21, 200718 yr Author Thanks-is there an easier way using Position and one of the Word functions?
December 21, 200718 yr It will break with just about any entry other than one word last names. RightWords (YourField; 1) Edited December 21, 200718 yr by Guest
December 21, 200718 yr Try: Let ( [ len = Length ( FullName ) ; end = Position ( FullName ; "," ; len ; - 1 ) ; start = Position ( FullName ; " " ; end ; - 1 ) + 1 ] ; Middle ( FullName ; start ; end - start ) )
December 21, 200718 yr Author thanks--stupid question, though...where does the Let function go in the Calc for the lastname field?
December 21, 200718 yr Author I haven't used the Let command before. Would I just enter what you posted into the Calc definition for the LastName field?
Create an account or sign in to comment