Connecting Tech Pros Worldwide Help | Site Map

Need to change LASTNAME, FIRSTNAME MI to FirstName M. LastName

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 02:04 PM
musicloverlch
Guest
 
Posts: n/a
Default Need to change LASTNAME, FIRSTNAME MI to FirstName M. LastName

I used to have a function that would change data that came across as
LASTNAME, FIRSTNAME MI to FirstName M. LastName with an update query.
Does that sould familar to anyone?

Thanks in advance,
Laura


  #2  
Old November 13th, 2005, 02:04 PM
pietlinden@hotmail.com
Guest
 
Posts: n/a
Default Re: Need to change LASTNAME, FIRSTNAME MI to FirstName M. LastName


musicloverlch wrote:[color=blue]
> I used to have a function that would change data that came across as
> LASTNAME, FIRSTNAME MI to FirstName M. LastName with an update query.
> Does that sould familar to anyone?
>
> Thanks in advance,
> Laura[/color]

Use InStr to find the position of the comma, and then just grab all the
stuff to the left and right of it.
Something along the lines of

1. Find position if comma INSTR(1,",",MyString)
2. Take everything to the left: LEFT$(MyString, INSTR(1,",",MyString)))
3. Take everything to the right: RIGHT$(MyString,
Len(MyString)-INSTR(1,",",MyString)))

Probably not exactly right, but it should get you going in the right
direction.

  #3  
Old November 13th, 2005, 02:04 PM
musicloverlch
Guest
 
Posts: n/a
Default Re: Need to change LASTNAME, FIRSTNAME MI to FirstName M. LastName

Thanks so much. Just in case anyone was wondering, this is my formula:

StrConv(Right$([Name],Len([Name])-InStr(1,[Name],",")-1) & " " &
Left$([Name],InStr(1,[Name],",")-1),3)

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.