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!

Name space issue

Status
Not open for further replies.

Noah114

Technical User
Mar 31, 2005
59
0
0
US
I am trying to create a function in a query that will pull the first letters of a name before the space. For example, I can get "JOHN" or "JOHN S." under first name. I try

Trim(Left([FIRST_NAME],InStr([FIRST_NAME]," ")))

But when I do than I get nothing back for the first on and JOHN back for the second. Any suggestions?
 
Code:
IIF(InStr([FIRST_NAME]," ")>0,
    Trim(Left([FIRST_NAME],InStr([FIRST_NAME]," "))),
    [FIRST_NAME})
 
Sorry ... typo
Code:
IIF(InStr([FIRST_NAME]," ")>0,
    Trim(Left([FIRST_NAME],InStr([FIRST_NAME]," "))),
    [FIRST_NAME[COLOR=red yellow]][/color])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top