Hi I’m trying to order entries by a field called surname but it just doesn’t seem to be working. changing orderby and sort to anything gives the same results - latest entry last in list.
Any ideas what I could be doing wrong?
{exp:query sql="SELECT member_id FROM exp_members WHERE group_id = '5'"}
{exp:member:custom_profile_data member_id="{member_id}" orderby="surname" sort="asc"}
<li><a href="{path=portfolios/gallery/{username}}"><img src="{photo_url}" width="138" height="103" alt="{screen_name}" /></a>
<h3 class="name"><a href="{path=portfolios/gallery2/{username}}">{firstname} {surname}</a></h3></li>
{/exp:member:custom_profile_data}
{/exp:query}