Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting Data 2

Status
Not open for further replies.

Neak1

Computer
Sep 10, 2001
12
Hey Everyone,

I have a field called Name. In this field there is First Name, Last Name and middle initial. The field is 22 characters long. Each Portion of this field is separated by a blank space. Ex: Mary K Jones or Micheal J Jordan Jr What I need to do is extract the First Name only from this field using a query. I am not sure what type of syntax to use to do this since all the First Names are different lengths. Is there some way that I can say stop at the first blank space and give me the results?

Please Help!!!

Neaka

 
Replies continue below

Recommended for you

you can use Instr() to find the space, and then once you know where the space is, use Left() to take the characters up to the space. See the VB help for syntax & examples.


 
The VBA function split() will separate all the words and will put them into array.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor