Need to sort several different fields together - Alphabetically

J

Jannette

I have to sort by last name, then first name, and by company (because some
businesses don't have a person assigned to them).

How can I achieve this!! Need help as soon as possbile.
 
K

Ken Snell \(MVP\)

Use an ORDER BY clause:

ORDER BY LastNameField, FirstNameField, CompanyNameField
 
J

John Spencer

Or if you mean you want to sort by Last Name and First Name, but if there is
no Last Name then you want to sort by company name.

ORDER BY NZ(LastName,CompanyName), FirstName, CompanyName


In the query design view, you would need to insert a calculated field before
the Firstname field
Field: SortThis: Nz(LastName,CompanyName)
Show: Not Checked
Sort: Ascending

Another way to handle this might be
Field: SortThis: Nz(LastName & FirstName & CompanyName)
Show: Not Checked
Sort: Ascending

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top