Seperating First Name

  • Thread starter Thread starter magmike
  • Start date Start date
M

magmike

I am using the following to separate the first name out for a greeting
line:

=("Dear " & Left([SentTo],InStr([SentTo]," ")) & ":")

However, this is how it displays "Mike Kline":

Dear Mike :

How do I eliminate that space?
 
I am using the following to separate the first name out for a greeting
line:

=("Dear " & Left([SentTo],InStr([SentTo]," ")) & ":")

However, this is how it displays "Mike Kline":

Dear Mike :

How do I eliminate that space?

Oh, look - I figured it out! =("Dear " &
Left([SentTo],InStr([SentTo]," ")-1) & ":")

I assumed it must somehow involve a "-1" but wasn't real sure where to
put it. But, if you play with something long enough
_________________________________ .
 
Use:

=("Dear " & Left([SentTo],InStr([SentTo]-1," ")) & ":")

However, it would be best to split the data over separate columns in the
table, which you can do using similar expressions in an UPDATE query, using
the InstrRev function to get the last name. If you have some with middle
names or initials you'll have to parse those out as well of course.

Ken Sheridan
Stafford, England
 
I am using the following to separate the first name out for a greeting
line:

=("Dear " & Left([SentTo],InStr([SentTo]," ")) & ":")

However, this is how it displays "Mike Kline":

Dear Mike :

How do I eliminate that space?

Just subtract one from the position of the space to get the position before
it:

=("Dear " & Left([SentTo],InStr([SentTo]," ")-1) & ":")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top