Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Name order

Status
Not open for further replies.

iansmithwolves

Technical User
Jan 24, 2003
53
GB
My database gives names as surname, firstname. How can I format them to come out as firstname,name?
 
Which database are you using? What is the table structure?
 
Here is the typical solution. Create a formula field with the following code:

Trim(Mid({EMPLOYEE.NAME},InStr ({EMPLOYEE.NAME},",")+2))+" "+Left({EMPLOYEE.NAME},InStr ({EMPLOYEE.NAME},",")-1)


Here I am assuming that the field is EMPLOYEE.NAME and that in the database it comes in as last name then comma then first name as in:

Smith, John

You may have to adjust your formula to meet your requirements.

Howard Hammerman,
Crystal Training and Crystal Material
On-site and public classes
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
If it's laid out as Howard says, you could also use this:
[tt]
Trim(Split({Table.Name},",")[2]) + " " + Split({Table.Name},",")[1];
[/tt]
-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top