You’re not using the weblog module to retrieve the entries, you’re using the query module, thus the orderby parameter isn’t needed. The query module will create the list in the right order. You don’t even need the {surname} variable, because that’s only needed for sorting within MySQL.
Yeah, I was thinking it would have to go through a straight query, as the EE sql generator I doubt is setup to do AS aliases on an ad hoc basis.
BTW, if someone were to have a last name of, say, “St. Germain” or “Le Monde”, it won’t sort correctly in those cases, as well as folks who sign up with different surname, givenname configurations, like many asian people who list their name in “last name first name” order (without a comma).
FYI
Thanks!
Jared