Change name from lower case to uppercase

Hi

This is a confusing one…apologies in advance!

I have a field that picks up name from db lookup. The name is set up in lower case. I firstly manipulate all surnames that begin with O to include O’. I have managed to do this.

Next problem two of the names are in lower case, but i want them to be in proper case so name is currently eg

joe o’reilly but i want it to be Joe O’Reilly…adding proper case to the surname only corrects the first letter but ignores reilly so i end up with O’reilly…any help greatly appreciated.

thanks

Subject: Change name from lower case to uppercase

you can always check for the presence of a ', and if one is found put the next char in uppercase, not that hard to do…

Subject: RE: Change name from lower case to uppercase

Hi Alain

Thanks for your reponse…

the code i have to convert the surname to include the O’ is

@If(@Begins(Surname;“O”) ;@Left( Surname ; 1 ) + “'” + @RightBack (Surname;1);

@If(@Begins(Surname;“o”) ; @Left( Surname ; 1 ) + “'” + @RightBack (Surname;1);

@If(!@Begins(Surname;“O”);@RightBack (Surname;0);“”)));

not sure where to take it from here…do i manipulate it here to put in proper case or should i do it in view…

Subject: RE: Change name from lower case to uppercase

If I understand your formula correctly, you assume that everyone who’s name starts with an O will be O’Something… there will be no last name that starts with a O without the ’ ?

@If(@Begins(Surname;“O”) ;@Left( Surname ; 1 ) + “'” + @RightBack (Surname;1);

@If(@Begins(Surname;“o”) ; @Left( Surname ; 1 ) + “'” + @RightBack (Surname;1);

--------> Not sure what that line is for…

@If(!@Begins(Surname;“O”);@RightBack (Surname;0);“”)));

Here is how I’d do it…

@If( @LowerCase(@Left(Surname; 1)) = “o”; “O’” + @UpperCase(@Middle(Surname; 2; 1)) + @RightBack(Surname; 3); Surname);

So you check if it starts with O, if not, returns the value, if yes, then takes the last name minus the first 2 chars (the O and the other first letter), prefix that with [O’] and the upper case of the other letter… that should do the trick…

Subject: RE: Change name from lower case to uppercase

Hi Alain

Thanks for your response…the formula i am using now in the view is …

name:=@ProperCase(surname);@If(@Contains(name; “'”);@Do(list:=@Explode(name; “'”);@Implode(@ProperCase(list); “'”));name) ;

@ProperCase(FirstName) + “” + MiddleName +" " + @Propercase(name)

This works for surname view but doesnt work for first name view…

Subject: RE: Change name from lower case to uppercase

Wow… ok, your formula is overly complicated, but ok, if it works for you…

Now what is the problem for the first name? @Propercase does not work?

Subject: RE: Change name from lower case to uppercase

name:=@ProperCase(surname2);@If(@Contains(name; “'”);@Do(list:=@Explode(name; “'”);@Implode(@ProperCase(list); “'”));name) + " " + @ProperCase(FirstName) + " " + MiddleName

this works for surname view it displays O’Gorman Lucy but i want to add it a first name view where it will display Lucy O’Gorman…

Subject: RE: Change name from lower case to uppercase

Sorry, I am still not sure I understand what you mean… but let me hazard a guess…

name:=@ProperCase(surname2);@If(@Contains(name; “'”);

CorrectName := @Do(list:=@Explode(name; “'”);@Implode(@ProperCase(list); “'”));name);

@ProperCase(FirstName) + " " + MiddleName + " " + CorrectName

Subject: RE: Change name from lower case to uppercase

Thanks for taking time out to help with this much appreciated…tried your last formula on here’s what it does…

I corrects all staff names that have the o begining

but for anyone else it doesnt show the surname…ahhh!!

Subject: RE: Change name from lower case to uppercase

In your formula, where does Surname2 come from?

Ok… can you try this formula, I really think it will do what you want it to…

CorrectName := @If( @LowerCase(@Left(Surname; 1)) = “o”; “O’” + @UpperCase(@Middle(Surname; 2; 1)) + @RightBack(Surname; 3); Surname);

@ProperCase(FirstName) + " " + MiddleName + " " + CorrectName

Subject: RE: Change name from lower case to uppercase

Hi Alain

Thanks for your help…your last formula works a treat on my first name view…one problem i’ve come across user name that doesnt begin with O or o so this surname remains in lower case. …but i’m nearly there thanks to your help…

Subject: RE: Change name from lower case to uppercase

ah right, try this, just added an @Propercase to the else of the if…

CorrectName := @If( @LowerCase(@Left(Surname; 1)) = “o”; “O’” + @UpperCase(@Middle(Surname; 2; 1)) + @RightBack(Surname; 3); @Propercase(Surname));

@ProperCase(FirstName) + " " + MiddleName + " " + CorrectName

Subject: RE: Change name from lower case to uppercase

Hi Alain

Thank you for help…it works but unfortunately changes names like McC to Mcc…i’ll play around with it…thanks

Subject: RE: Change name from lower case to uppercase

And those are all lowercase to start with (mccain) or another way (mcCain or McCain) and do you have variants (mccain or maccain or MacCain, or macCain), and do you have a lot of such exceptions? I am starting to think you are irish lad :slight_smile:

CorrectName := @If( @LowerCase(@Left(Surname; 1)) = “o”; “O’” + @UpperCase(@Middle(Surname; 2; 1)) + @RightBack(Surname; 3); @UpperCase(@Left(Surname; 1)) + @Rightback(Surname; 1));

@ProperCase(FirstName) + " " + MiddleName + " " + CorrectName;