Splitting a string
Splitting a string
(OP)
I am trying to split a string that contains a fist name and surname so that only the first name shows ?
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS Come Join Us!Are you a
Computer / IT professional? Join Tek-Tips Forums!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines |
|
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.
RE: Splitting a string
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.
-k
RE: Splitting a string
//first name
Left({table.name},instr({table.name}," ")-1)
//last name
mid({table.name},instr({table.name}," ")+1)
-LB
RE: Splitting a string
-k