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 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
Joined
Sep 10, 2001
Messages
12
Location
US
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

 
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

Back
Top