I had a similar problem on the website on which I built a full case report. I wanted reports of cases where the name of the victim is known to be sorted at the top, because they are more convincing. Conversely, I wanted all of John Doe's affairs to be downstairs. Since this is also related to people's names, I also had a problem with the name firstname / lastname. I did not want to divide it into two name fields, because some cases are not people at all.
My decision:
I have a "Name" field that is displayed. I also have a NameSorted field that is used in all queries but never displayed. The I / O user interface will take care of converting "LAST, FIRST" to the sort field automatically.
Finally, to โsetโ the sort, I simply put the appropriate characters at the beginning of the sort field. Since I want the material to come out at the end, I put "zzz" at the beginning. To sort at the top, you can put "!" at the beginning. Again, your editing user interface can take care of this for you.
Yes, I admit it is a little cheezy, but it works. One of the advantages for me is to make more complex queries with associations in different places to create pages compared to RSS, etc. And I donโt need to remember a complex expression to get the right to sort, itโs always easy to sort by โNameSortedโ "
Click my profile to see the resulting website.
source share