Body: <p>Which method really works if search results listing (doesn't matter, simple search or advanced one, both are the same) should be sorted by Last name, not by Contact ID? Things we've tried so far (none works):</p>
  
  <ol>
  <li>"Include Order By Clause" radio button at <strong>Administer -> Customize Data and Screens -> Search Preferences</strong>  (per <a href="https://civicrm.stackexchange.com/questions/3481/why-arent-my-advanced-search-results-sorting-properly">this</a> suggection)</li>
  <li><strong>Individual Sort Name Format at yoursite/civicrm/admin/setting/preferences/display?reset=1</strong> per <a href="https://forum.civicrm.org/index.php?topic=35380.msg150331#msg150331" rel="nofollow noreferrer">this</a> suggestion </li>
  <li>Sort name checked in the DB, no influence on search results display. </li>
  </ol>
  
  <p>Guess there should be some kind of "easy fix" like adding "ORDER BY LAST_NAME DESC" somewhere among templates. Or we need to go deeper into hooks/custom extension system? </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-17T17:32:39.797Z
Comments.Text: Have you tried the settings in civicrm/admin/setting/search?reset=1 you should be able to have an alpha pager and set the sort results?
Comments.UserDisplayName: Parvez Saleh
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-17T17:38:29.427Z
Comments.Text: Also by default CiviCRM is set to sort by last name, check the sort name setting in this page civicrm/admin/setting/preferences/display?reset=1
Comments.UserDisplayName: Parvez Saleh
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-17T17:53:37.880Z
Comments.Text: @Parvez Saleh Thank you for notes; yes, I've tried both and even mentioned this in an initial question, in order to highlight, that standard ways doesn't work..
Comments.UserDisplayName: yurg
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-18T09:51:09.893Z
Comments.Text: If you have access to the Database you can check what values are stored in the sort_name field for the contacts, if this is wrong/incorrect then that might be the issue and they'll need to be re-evaluated, which can be done using CiviCRM functions.
Comments.UserDisplayName: Parvez Saleh
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-19T18:29:41.180Z
Comments.Text: @Parvez Saleh  Thank you for note; that is what we've done before, as it stated in #3 of the initial question..
Comments.UserDisplayName: yurg
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-27T10:07:01.423Z
Comments.Text: One need to implement custom code changes, according to http://civicrm.stackexchange.com/questions/7783/query-php-function-modify?lq=1
Comments.UserDisplayName: yurg
Tags: <search><search-results><sort-order>
Title: Search result sort by Last Name
ThreadText: # Search result sort by Last Name
  
  (Asked by: username_0 on 2015-11-17)
  
  Which method really works if search results listing (doesn't matter, simple search or advanced one, both are the same) should be sorted by Last name, not by Contact ID? Things we've tried so far (none works):
  
  1. "Include Order By Clause" radio button at **Administer -> Customize Data and Screens -> Search Preferences** (per [this](https://civicrm.stackexchange.com/questions/3481/why-arent-my-advanced-search-results-sorting-properly) suggection)
  2. **Individual Sort Name Format at yoursite/civicrm/admin/setting/preferences/display?reset=1** per [this](https://forum.civicrm.org/index.php?topic=35380.msg150331#msg150331) suggestion
  3. Sort name checked in the DB, no influence on search results display.
  
  Guess there should be some kind of "easy fix" like adding "ORDER BY LAST\_NAME DESC" somewhere among templates. Or we need to go deeper into hooks/custom extension system?
  
  **Tags:** search, search-results, sort-order
  
  > **Comments:**
  > **username_1**: Have you tried the settings in civicrm/admin/setting/search?reset=1 you should be able to have an alpha pager and set the sort results?  
  > **username_1**: Also by default CiviCRM is set to sort by last name, check the sort name setting in this page civicrm/admin/setting/preferences/display?reset=1  
  > **username_0**: @username_1 Thank you for notes; yes, I've tried both and even mentioned this in an initial question, in order to highlight, that standard ways doesn't work..  
  > **username_1**: If you have access to the Database you can check what values are stored in the sort_name field for the contacts, if this is wrong/incorrect then that might be the issue and they'll need to be re-evaluated, which can be done using CiviCRM functions.  
  > **username_0**: @username_1  Thank you for note; that is what we've done before, as it stated in #3 of the initial question..  
  > **username_0**: One need to implement custom code changes, according to http://civicrm.stackexchange.com/questions/7783/query-php-function-modify?lq=1  
  
  ---
  
  ## 0 answers
  
  