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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First Name, Last Name, Uppercase Lowercase, I had to share

Status
Not open for further replies.

Cort

MIS
Apr 16, 2002
154
US
Hello folks I'm always asking for help and everything but have become pretty dang proud with one of my creations I needed to share. If anyone runs into the problem of having to show [lastname], [firstname] and also get the capitalization right it can be a pain. Espically if, like in my case all the letters are in uppercase.

Well, here is a formula that will get you Last, First no matter the legnth of the fields or their current case state. I'm sure one of the pros could probably polish this up some but hopefully this will be of use to someone.

---

Uppercase(left({LAST_NAME},1)) &
Lowercase(right({LAST_NAME},Len({LAST_NAME})-1)) & ", " &
Uppercase(left({FIRST_NAME},1)) &
Lowercase(right({FIRST_NAME},Len({FIRST_NAME})-1))

-----
 
I don't mean to be a pain, but in version 9 Crystal very kindly provided a function Propercase (which displays how i've typed it)

Still a good workaround for Versions below 9 though! Reebo
Scotland (Going mad in the mist!)
 
Thats pretty good.

Version 9 has a ProperCase function which does this automatically, but it doesn't come with prior versions.

I think you can also still download a function for prior versions of CR that do this, if you can find U2Lcaps.dll. I think it is still on CD's website.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Some databases provide this function as well. Oracle has INITCAP which capitalzes the first letter of each word and changes all others to lower case. Works well for things like JOE MC MILLAN unfortunately won't work if they don't place a space after the MC

Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top