Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Qruery: Primary & secondary sort? 1

Status
Not open for further replies.

GaborH

Technical User
Nov 5, 2003
48
US
I am trying to create a combo box that lists employees by job title and last name within a job title. I know that queries can only sort on field, and I can achieve a virtual primary/secondary sort with a field that would combine title and last name. But I wonder if there a simpler way of doing this?
 
The ORDER BY clause can sort on multiple fields and it can also sort on calculated fields. If you have, as in your example, TITLE and LASTNAME fields then
[tt]
ORDER BY Title, LastName
[/tt]

will sort by Title and, within each title, by last name. Is that what you are after?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top