Capitalization

I am using a field in which the values returned could be, all CAPS, all lowercase or a mixture. I want the field to be consistent with Caps and Lowercase. Using the InitCap function only initial caps the first word. Is there a way to have it initcap all words? Example:

Value Final Result
NEED DOC Need Doc
Need doc Need Doc
need doc Need Doc
2 TO 4 FAM 2 to 4 Fam
2 To 4 FAM 2 to 4 Fam
2 to 4 fam 2 to 4 Fam


TMullan :us: (BOB member since 2007-03-08)

Where does the value in this field coming from?


ravisharma (BOB member since 2007-06-08)

It’s coming straight from the source/database.

Thanks.

T


TMullan :us: (BOB member since 2007-03-08)

Hi Mullan,

Try using Upper() and Lower() functions to return the result into lower and upper cases.

Let me know if that does not work for you.

Thanks,
Muskaan.


muskaan (BOB member since 2006-03-17)

Using upper and lower would only either capitalise the whole thing or lowecase the whole thing.

you could use substr and strlen to get the first letter capiatlised using UPPER() and LOWER()

there is a proc you can use on a database to capitalise the first letter of each word

here

but I’m sure there is a function that can do this. which database you using eg Oracle, SQL, Sybase etc.

Cheers

kedge


kedge (BOB member since 2007-02-14)

Please see the WordCap() function which is available in Deski.


Dave Rathbun :us: (BOB member since 2002-06-06)

That’s the function I was thinking of :slight_smile:

Makes sense now :slight_smile:

But does that work in Webi?


kedge (BOB member since 2007-02-14)

Hi,

It can be done with Initcap() function also.

Thanks,
Msukaan.


muskaan (BOB member since 2006-03-17)

Initcaps() only does the first letter of the object not the first letter of the each word in the object. Unless there is a clever way of implementing it.

WordCap() does the first letter of each word, but I’m unsure as to whether this will work correctly in Deski.


kedge (BOB member since 2007-02-14)

It certainly works in Deski, as I verified that the function was still there before posting earlier. :slight_smile: As this is the “Deski” forum I did not bother to check in Webi since the original poster did not request that.


Dave Rathbun :us: (BOB member since 2002-06-06)