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

Expression for Spliting Double Name

Status
Not open for further replies.

CCS8DENI

Technical User
Jul 20, 2000
31
AU
I have a feild in my query that contains both first and surnames in reverse order of a person, ie. MCMillan Andrew .

I want to add a feild in the query that contains an expression that will include the letters from the left od the feild until it reaches a space and another feild that includes letters from the right until it reaches a space, thus spliting the two names up so I can better use them in other ways.

Here's hopinfg this isn't clear as mud,

Regards

Andrew
Andrew
andrew.mcmillan@det.nsw.edu.au

Technology Adviser
Dept. of Education and Training
Deniliquin District
New South Wales
Australia
 
First of all, you should store the first and last names in separate fields in your table. You can always concatenate them for reports/forms when necessary. That said, try this

SurName:Left([Name],InStr([name]," ")-1)
FirstName:Right([Name],InStr([name]," ")+1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top