Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2013
    Posts
    8

    Unanswered: How to separate the last name from the first name - Crystal Reports 11

    Hello,
    I am trying to separate the first name from the last name.

    Example data: Doe, Jane

    I need to display Doe on one column and Jane on a separate column.

    Any help is greatly appreciated!

    Rb

  2. #2
    Join Date
    Jul 2007
    Posts
    61
    Can you guarantee the comma between last name and first name? If so I would use the InStr function to find the position of the comma and then use Left and Right to get the bits you want.

    So if your field is called {Table.Person} then:

    if InStr ({Table.Person} ,",") = 0
    then {Table.Person} //If no comma present then return Person
    else left({Table.Person} ,InStr ({Table.Person} ,",")-1)

    HTH,
    Caspar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •