Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Sage MAS Partner
mblocker1
Posts: 14
Registered: 03-30-2009
0

formula to separate data from one field to two field

In payroll there is only first name field which includes middle initial and period. Need to be able to take John A. (every employee with middle initial has a space between first name and ends with period) and split into two fields one for John and one with just the A and not the space for middle initial. similiar I need to separate last name field which contains last name and suffix so for example Smith III needs to be two fields one with Smith and one with III (every last name with suffix is separated by a space)

Regular Contributor
Gator
Posts: 271
Registered: 12-05-2008
0

Re: formula to separate data from one field to two field

Assuming you are talking about crystal reports...

 

FirstName:

if InStr({PR1_EmployeeMaster.FirstName}," ")>0 then Left({PR1_EmployeeMaster.FirstName},InStr({PR1_EmployeeMaster.FirstName}," ")-1) else {PR1_EmployeeMaster.FirstName}

 

MiddleInitial:

if InStr({PR1_EmployeeMaster.FirstName}," ")>0 then Replace(Mid({PR1_EmployeeMaster.FirstName},InStr({PR1_EmployeeMaster.FirstName}," ")+1),".","") else ""

 

The other two will be similar.

Sage MAS Partner
mblocker1
Posts: 14
Registered: 03-30-2009
0

Re: formula to separate data from one field to two field

Thanks that worked!