We have a content type named "Person", which has fields as Full Name, Age, Address etc.
There are thousands of people entries on the site. We are using Views to sort out people's list on different pages as per need.
Lately, there has been a requirement that we need to sort the list of people by Last Name. But the problem is that there's no last name field as there's only "Full Name" field of the person in the site.
I am using views to sort the results in the pages and I am not sure how to sort the results by last name. Is there any way I can achieve this?
May be I can create a field as "Last Name" in the content field but is there a way I can dynamically fill in the Last Name by extracting Last word from Full Name?
May be through someway in SQL?
Any idea or assistance would be highly appreciated.
Thanks.
ALTER TABLE
tbl_name` ADD LastName AS RIGHT(FullName, CHARINDEX(' ', REVERSE(FullName)) - 1) PERSISTED` – DRUPWAY Dec 2 '14 at 6:15