Sorting

A

Aless

I have set up a query where the records selected are sorted by date. Is it
possible to then sort the records by another field so that sorting by date
takes priority and then the records are further sorted by the second field?

I have tried putting Ascending in both the field but this does not work -
sort by date does not seem to happen.

Al
 
A

Arvin Meyer

Aless said:
I have set up a query where the records selected are sorted by date. Is it
possible to then sort the records by another field so that sorting by date
takes priority and then the records are further sorted by the second field?

I have tried putting Ascending in both the field but this does not work -
sort by date does not seem to happen.

A query will sort by the order the fields are listed in the Order By
statement in the query. A report has it's own sorting and grouping.:

Select * From Whatever Order By Field1, Field2, Field3 Desc;

Sorts ascending by Field1 then 2 then descending by Field3
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
A

Aless

Thank you for the information.

This is probably a stupid question but where exactly would I put the Order
By statement in the query?

Al
 
A

Arvin Meyer

If you are looking at an SQL window, you'd put it at the end of the rest of
the SQL statement. Click on View on the menu when a query is open in Design
View. You can also use the QBE grid (Design View) and select the sort. Keep
in mind that the selections will sort from left to right.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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