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

Formula - Text Case

Status
Not open for further replies.

pjmdesigns

Technical User
Mar 7, 2003
39
GB
I have a field(string) {FIRSTNAME} where the Text Case is inconsistent, i.e. I want to display "Andrew" but the field may contain "aNDrew".

At the moment I am using:

(Uppercase(left({FIRSTNAME},1)))+(Lowercase(mid({FIRSTNAME},2,20)))

Is there a quicker way or even a specific function?

Cheers!
PJ
 
CR 9 has the Propercase function.

In CR 8.5 and earlier, to format the string or text field similar to the ProperCase function, use the LeadingCaps User Function Library (UFL). The LeadingCaps UFL can be obtained by searching for the file name, Uflcaps.exe, on the CD site at:


-k
 
You mean like a ProperCase or InitCap function. I'm not sure if this has been introduced in V9, but this function certainly is not available in v8.5 and under. The way you are doing it is pretty much how you have to treat string fields in order to mimic ProperCase, (except that I would lose the '20' condition in the MID clause, as it's not necessary, and will just allow the 21st+ character(s) to return in their original case.)

Naith
 
It has been introduced, Naith.

And there's a UFL for the equivalent of initcap at the above URL.

-k
 
Yeah, I'd forgotten about the LeadingCaps UFL. Thanks for the heads up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top