Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splitting a Employee Name field 1

Status
Not open for further replies.

ace323

IS-IT--Management
Feb 17, 2006
5
US
We are running Timberline accounting package. Our employee names were enter last, first, M example (doe; John L) I need to plit this field in two three seperate fields. Was is the correct way to do this.
 
You could use

Code:
Left({ReportField},Instr({ReportField},";")-1)

to get the last name, but seperating the first and middle will never be an exact science.

You can't look for the space because I assume sometimes there isn't a middle initial. That's fine, but there is a space befor the first name, which would cause problems. Also someone's first name could be Bobby Jo with no middle initial. If you took the value right of the space you would get Jo as a middle initial, which is incorrect.

I would break it into two fields...First/Middle and Last.
 
Try:

//{@lastname}:
split({table.name},";")[1]

//{@firstname}:
if ubound(split({table.name}," ") >= 2 then
split(split({table.name},";")[2]," ")[1] else
split({table.name},";")[2]

//{@middle}:
if ubound(split({table.name}," ") >= 2 then
split(split({table.name},";")[2]," ")[2] else
""

There are limitations to this as juice05 pointed out.

-LB
 
It says the formula result must be a number
 
//{@firstname}:
if ubound(split({table.name}," ")) >= 2 then
split(split({table.name},";")[2]," ")[1] else
split({table.name},";")[2]

//{@middle}:
if ubound(split({table.name}," ")) >= 2 then
split(split({table.name},";")[2]," ")[2] else
""
Sorry, forgot some parens.

-LB
 
It says remaing text does not seem to be apart of the formula.

if ubound(split({MASTER_PRM_EMPLOYEE.Employee_Name}," ")) >= 2 then
split(split({MASTER_PRM_EMPLOYEE.Employee_Name},";")[2]," ")[1] else
split({MASTER_PRM_EMPLOYEE.Employee_Name},";")[2]

//{@middle}:
if ubound(split({MASTER_PRM_EMPLOYEE.Employee_Name}," ")) >= 2 then
split(split({MASTER_PRM_EMPLOYEE.Employee_Name},";")[2]," ")[2] else
""

 
{@firstname} and {@middlename} are two separate formulas.

-LB
 
THANKS A TON LB!!!

It worked, I had to make 1 adjustment, but you send me in the right direction :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top