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)