Query Sort

G

Greg

Hi all

I have made a query where it is looking up a ladder for a league I run. I
have set the query into the three fields which are

Name Points Legs


I wish for it to be sorted in this order

The points descending.
then if some are equal then legs in descending order.
the if still the same it need to sort the field name in ascending order.

I have set the ascending descending etc.
But it is only doing the name field. What am I doing wrong?

Thanks

Greg
 
D

Douglas J. Steele

What does the SQL of your query look like? (If you're not familiar with
looking at SQL, open the query in Design View, then go to the View menu and
select SQL View).

The end should look like:

ORDER BY MyTable.Name, MyTable.Points, MyTable.Legs

Note: Name isn't a good choice for a field. Name is a reserved word, and
using reserved words for your own purposes can lead to problems. If you
cannot (or will not) change the name, at least put square brackets around
it.
 
J

John Vinson

Hi all

I have made a query where it is looking up a ladder for a league I run. I
have set the query into the three fields which are

Name Points Legs


I wish for it to be sorted in this order

The points descending.
then if some are equal then legs in descending order.
the if still the same it need to sort the field name in ascending order.

I have set the ascending descending etc.
But it is only doing the name field. What am I doing wrong?

Sorting is done left to right in the query grid. Just move the Name
field (and rename the field, as Douglas suggests!!) to the right of
the Legs field.

Don't want to see the fields in that order on the screen? No problem;
just create a continuous Form based on the query and use it to display
the data, arranging the textboxes as you wish. Query datasheets aren't
designed for viewing or editing data.

John W. Vinson[MVP]
 

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