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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract LastName, FirstName, MI into three fields 1

Status
Not open for further replies.

ThereUare

Programmer
Oct 16, 2007
16
US
I'm having a brain fart righ now. I can only do this to extract the LastName and First Name, but I also get the Middle Initial from the first name. I need something to only extract the First Name. Please Help. This is my formula so far.

This is the field I need to extract from:
LastName, FirstName MI

Formula: (Used in a Query)gets the firstname and MI
FName: Mid([FullName],InStr([FullName]," ")+1)

I need only the FirstName, but it would be nice if it sees the MI to insert it into a MI field.
 
Thanks but I know there is something easier I can just use in a query. I don't want to have to use code and look for specific events. It should just be a simple query.
 
FName: Trim(Mid(Left(FullName,InStrRev(FullName," ")),1+InStr(FullName,",")))
MI: Mid(FullName,InStrRev(FullName," ")+1)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Wow that really helped. I was about to give up on it. Thank you very much for your Help PHV.

I was wondering if you had something in case the FullName did not have a middle initial? It seems to work very good until you come up with a name without a middle initial.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top