|  | Seperating First Name |  | |
| | | magmike |  |
| Posted: Tue Sep 16, 2008 8:25 pm Post subject: Seperating First Name |  |
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? |
| |
| | | Ken Sheridan |  |
| Posted: Tue Sep 16, 2008 8:25 pm Post subject: RE: Seperating First Name |  |
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
"magmike" wrote:
| Quote: | 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?
|
|
| |
| | | John W. Vinson |  |
| Posted: Tue Sep 16, 2008 8:25 pm Post subject: Re: Seperating First Name |  |
On Tue, 16 Sep 2008 13:25:48 -0700 (PDT), magmike <magmike7@yahoo.com> wrote:
| Quote: | 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) & ":") --
John W. Vinson [MVP] |
| |
| | | magmike |  |
| Posted: Tue Sep 16, 2008 8:45 pm Post subject: Re: Seperating First Name |  |
On Sep 16, 3:25 pm, magmike <magmi...@yahoo.com> wrote:
| Quote: | 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 _________________________________ . |
| |
|
|