Hi there
I'm trying to sort data (list of local doctors) by last name (surname). The only problem is that my Node Title is the doctors name and I don't want to have to enter the data twice or re-enter all that data.

Is there some sort of argument or something I put into my view to make it work that way. Any help is appreciated.

To see the site in question, go to www.upstatehealthlink.com

Thanks
JR

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Sorry, Views only sorts on the data you have. Your best bet might be to use something like CCK computed field to calculate what the last name is and create a hidden field for sorting. But Views can't do this without placing the data in the database.

jack_ruby’s picture

Thanks for in the advice,
What I'm wondering: is there not a way to tell views to sort the Name field (firstname lastname) so that it sorts by everything after the "space" character ?
I'll check into using CCK to do that, too.

Thanks
JR

merlinofchaos’s picture

Sorry, SQL can't do that, and Views just creates SQL queries, ultimately.

jack_ruby’s picture

Thanks, I found this node
http://drupal.org/node/559618
which seems helpful

JR

ilw’s picture

Hello,

Could you lease share with me, Did you find a solution for that?

jack_ruby’s picture

I was able to solve the problem only by separating the "name" field into "first name" and "last name". It can be tedious, but it's the only way I can see to do it. If you have the sql skills, you can just write a query to break the field up into two new fields. then just build the view with the two new fields. Hope that helps!
JR