Link to home
Start Free TrialLog in
Avatar of Amanda Walshaw
Amanda WalshawFlag for Australia

asked on

Firstnames

issues with middle name

in one column I  have a firstname and a middle name

Gwenda agnes
Pamela joyce
Jocelyn ruth
Gregory ian
Cheryl joy

and sometimes  just one name
John

Where you have two names in the firstname column how do you get it to appear as

Gwenda Agnes

If there is only one space between the next name?
Avatar of santoshmotwani
santoshmotwani
Flag of Australia image

hope this helps :

link
Avatar of Amanda Walshaw

ASKER

sorry page not found
Avatar of PortletPaul
http://www.devx.com/tips/Tip/17608 (worked for me)

It's an "Initial Capitals" function
sorry its taking me to an advertisment about registering in San francisco
-update Staging_mytable
set firstname = Replace(Firstname,reverse(left(reverse(firstname),len(firstname)-1)),  reverse(lower(left(reverse(firstname),len(firstname)-1))))      ,


I have used this query but I am getting struck by the middle name, it is consistent with one space.
i have copied the script into .txt file from the link .... its a same link that PortletPaul has posted.
notepad.txt
SOLUTION
Avatar of santoshmotwani
santoshmotwani
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
update dbo.mytable
set firstname = Replace(Firstname,reverse left(reverse(firstname),len(firstname)-1)))) + ' ' + reverse(lower(left(reverse(firstname),len(firstname)-1)))
where Firstname = 'Kym dianne'
and LastName = 'Spoors'

unfortunately getting error message
The replace function requires 3 argument(s).
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So much for "no points please".  Oh well ...