extracting data from a field in a table.

darksniper

Registered User.
Local time
Today, 03:50
Joined
Sep 4, 2005
Messages
108
when I have created my table I have created a field called name that stored both last and first name. Right now I need to extract the the last name from the the field name and store it in another field "lastName". Any ways to do that?
 
Yes, depending on the format in the "name" field will be how hard or easy it is.
 
it is a text field. and the data in that field would be something like this: "John Wood" or "Arnold Terminator" as an example.
 
If the separator between first and last name is always a space and you have no middle names, this will work:

Code:
LastName = Right([Name],Len([Name])-InstrRev([Name]," "))
FirstName = Trim(Left([Name],InStr(1,[Name]," ")))
 
allthough the only thing I forgot to ask, where do I put the code?
 

Users who are viewing this thread

Back
Top Bottom