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

split name into first name and surname

Status
Not open for further replies.

tizwaz

Technical User
Aug 8, 2002
437
GB
Can anyone see what I am doing wrong here

I have a field called Current Pass Holder which has a full name in it in the format Surname First Name

I have put the following code into a query - the surname comes out fine but the first name is sometimes ok and sometimes takes part of the surname as well

eg name shown as Garner Sarah has split as r Sarah Garner

FirstName: Trim(Right([Current Pass Holder],InStr([Current Pass Holder]," ")))

Surname: Trim(Left([Current Pass Holder],InStr([Current Pass Holder]," ")))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top