Make a query sort by last name in ascending order

M

M. Reese

What would I need to type to get a query to sort records by last name first.

Thanks in advance
 
K

KARL DEWEY

If you are talking about a query and last name is in a separate field, open
query in design view and in the grid row labeled Sort select Ascending. If
you are sorting by last and first names you must place the last name field to
the left of the first name field in the grid by dragging to the correct
position.
If you are talking about a form then you a query modified as above.
For a report you must use the Grouping and Sorting of the report to have it
list ascending as it will ignore any sorting done in the query.
 
F

fredg

What would I need to type to get a query to sort records by last name first.

Thanks in advance

Access sorts fields in left to right order.

In the query Sort row of the LastName column enter
Ascending
If you additionally wish to sort by FirstName next, set the FirstName
column to the right of the LastName column and enter
Ascending
in that Sort row.
 
M

MGFoster

M. Reese said:
What would I need to type to get a query to sort records by last name first.

Thanks in advance

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In the SQL view make the ORDER BY clause look like this:

ORDER BY last_name

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSd5op4echKqOuFEgEQJnJgCg8KW4icCWugudaYPtsYw2q23/9dkAn1GA
q3nbXRDVm1g7hW5d5CsUY7C7
=2q6t
-----END PGP SIGNATURE-----
 
J

John Spencer MVP

I see all the replies and I hope that answers your question. On the other
hand if you have one field that contains both the first name and last name
then you have to use some VBA functions to isolate the last name in a separate
calculated field and order by the calculated field.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
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