dbTalk Databases Forums  

Reformatting of Names

comp.database.ms-access comp.database.ms-access


Discuss Reformatting of Names in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
FishezUk
 
Posts: n/a

Default Reformatting of Names - 08-04-2003 , 09:24 AM






Hi Again People

Don't know if this is possible or not! Maybe one of you wonderful
people can help me out.

I am still developing this database and wondered if it is possible
using a query to change the format of a name as shown below.

Smith, John

I would like to change to show

John Smith

Any help would be grately appreciated if anyone has any ideas or if
this is even possible.

Many Thanks in advance.

John

Reply With Quote
  #2  
Old   
janthony
 
Posts: n/a

Default Re: Reformatting of Names - 08-04-2003 , 11:56 AM






fishezuk (AT) btopenworld (DOT) com (FishezUk) wrote in message news:<3b07e12c.0308040624.1dcf6bab (AT) posting (DOT) google.com>...
Quote:
Hi Again People

Don't know if this is possible or not! Maybe one of you wonderful
people can help me out.

I am still developing this database and wondered if it is possible
using a query to change the format of a name as shown below.

Smith, John

I would like to change to show

John Smith

Any help would be grately appreciated if anyone has any ideas or if
this is even possible.

Many Thanks in advance.

John
Actually you can do it a couple of ways.

In either your query or a SQL statement in code or just through an
update proceedure. But any way you do it, just parse out the string.
Find the comma after the last name, trim off the last name up to the
comma position in the string. Then Trim off the first name starting
one postion to the right of the comma in the string.

SO something like this.....

Dim strName as string
Dim intPOS as integer
Dim strLast as string
Dim strFirst as string

strName = "THE FIELD THAT HAS THE FULL NAME"
intPOS = InStr(strName, ",")
strLast = Left$(strName, intPOS - 1)
strFirst = Mid$(strName, intPOS +1)


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.