2 Replies Latest reply on Apr 5, 2014 4:17 AM by BKBK

    How to extract last name from a string

    weezerboy Level 1

      I have SQL query that returns last name of a person and I need to extract the last part of any hyphenated or last names with a space in them

       

      In cases where the person has one last name everything is OK

       

      Like Smith. That OK. . I am looking for just Smith

       

      The problem I have is when I have hyphenated last names like Scott-Thomas

      In that case I want to extract the last last name or Thomas.

       

      Or if I have a last name like Rodham Clinton.
      In that case I only want to extract the last last name Clinton.

       

      How do I do this?