Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Splitting a string

Splitting a string

Splitting a string

I am trying to split a string that contains a fist name and surname so that only the first name shows ?

RE: Splitting a string

Hmmm, and how do you intend to handle names like:

Oscar De La Hoya?
Dr. Bob P. Jones?

The problem is that whoever was responsible for creating this data source was incompetent.

You can make assumptions and try to extract this, but the rules are extensive, I used to clean lists for a living...

The simple means is to use:

first name
Left({table.nakme},instr(" ",{table,name})-1)

last name
mid({table.nakme},instr(" ",{table,name})+1)

But there are so many gotchas in names that you'll be correcting the rules forevermore...

The best bet is to correct the data source, if you find it too tedious, intersperse the boredom with firing red hot reminders of your displeasure at the database designer using a nailgun.

There used to be some 3rd party products to help with this, perhaps one of those might help clean the list.


RE: Splitting a string

SV inverted the formula a bit, and probably intended:

//first name
Left({table.name},instr({table.name}," ")-1)

//last name
mid({table.name},instr({table.name}," ")+1)


RE: Splitting a string

Thanks, LB.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close