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

String Syntax finding the first " " 1

Status
Not open for further replies.

redsand

Programmer
Aug 15, 2001
45
0
0
US
I am pulling data and need to parse out the first name part of a employee name field to be used in a mail merge.

Example : Scott Smith. I need to pull the Scott.

Any help would be greatly appreciated.

Thanks

 
Hi!

Assuming you are sure that each record will be formatted the same you can use:

FirstName: Left(YourNameField, InStr(YourNameField, " ") - 1)

This will take out the first name. I think that the Left and InStr will work in SQL, if not, you can create a public function in a module to do the work and call the function from your query.

hth
Jeff Bridgham
bridgham@purdue.edu
 
I won't re-invent the wheel for ya. There are a lot of guys who have written this in these forums.

Click the Advanced Search link and put in parse or parsing.

You should get a dozen ways to do it.

Good luck.

lonniejohnson@prodev.com
ProDev, MS Access Applications B-) ,
May God blow your mind with His Glory in 2003.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top