Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Access

Seperating First Name

 
Jump to:  
 
magmike
PostPosted: 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
PostPosted: 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
PostPosted: 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
PostPosted: 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
_________________________________ .
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

wupe agencje tłumaczeń tanie pozycjonowanie Och słodka - Dżem stroje pływackie