Hello
There,
How can one separate a text into 2 columns (FirstName and LastName).
The only Hint I have is the UpperCase of the second name.
Eg. EdwardJohn I want it to be Edward in one column and John in the second column.
Any help shall be appreciated
Splitting Names
Page 1 of 12 Replies - 921 Views - Last Post: 22 November 2012 - 10:09 PM
Replies To: Splitting Names
#2
Re: Splitting Names
Posted 22 November 2012 - 11:19 AM
You haven't told us what database you are using. MySQL has functions like Locate()/Instr() which you could use to find the position of a string in another (like searching for the upper case letter of the last name). You can also use SUBSTR to then use that position to break the string.
But of course the available functions depends on the database. Either way, look through the string functions available to your database, find the functions that can first locate the upper case of the last name and return a position. Once you have that, you can pull substrings/split based on that position.
But of course the available functions depends on the database. Either way, look through the string functions available to your database, find the functions that can first locate the upper case of the last name and return a position. Once you have that, you can pull substrings/split based on that position.
#3
Re: Splitting Names
Posted 22 November 2012 - 10:09 PM
thanks for your reply.My database is Sql Server 2008.I know there is a substring function and uppercase function.
However I am getting difficulties to use to get my desired results.
Please if possible can you go deeper and write the syntax?
However I am getting difficulties to use to get my desired results.
Please if possible can you go deeper and write the syntax?
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|