SteveL13
asked on
Create two calculated fields in a table based on one field entered
I have a table with a field named "Name". If I enter John Doe in the field I want two calculated fields in the table to populate. One being "FirstName" and the result of the calculation would be "John". The other calculated field would be "LastName" and the result would be "Doe".
I've tried these expressions in the FirstName calculated field but get an error. (all characters up to the first space)
Left([Name],(InStr(1,[Name ]," "))-1)
and
Left(Name, Instr(1, Name, " ") - 1)
and
Left(Name,Instr(Name," ")-1)
But then also, what would be the proper expression for the LastName?
But I also think I need to trim any leading spaces before and after "John Doe" in the event one was typed, correct?
I've tried these expressions in the FirstName calculated field but get an error. (all characters up to the first space)
Left([Name],(InStr(1,[Name
and
Left(Name, Instr(1, Name, " ") - 1)
and
Left(Name,Instr(Name," ")-1)
But then also, what would be the proper expression for the LastName?
But I also think I need to trim any leading spaces before and after "John Doe" in the event one was typed, correct?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
trim(left(trim(t), instr(trim(t)," ")-1))
trim(right(trim(t),len(tri