Custom Order By

C

Chad

I have a quick question:

I have a query that returns a 'Club' field and a 'Total' field which is
grouped by 'Club'. There are only 3 clubs available, but I would like to
specify the order they returned. For example, I have clubs A, B, C and I
would like them to be returned in the order B, C, A.

For now I am creating a new field and associating a number with each club,
and then sorting based off of that field. Is there another way to do this?
Or is the way I am accomplishing it the only way?

Thanks everyone,
Chad
 
F

fredg

I have a quick question:

I have a query that returns a 'Club' field and a 'Total' field which is
grouped by 'Club'. There are only 3 clubs available, but I would like to
specify the order they returned. For example, I have clubs A, B, C and I
would like them to be returned in the order B, C, A.

For now I am creating a new field and associating a number with each club,
and then sorting based off of that field. Is there another way to do this?
Or is the way I am accomplishing it the only way?

Thanks everyone,
Chad

You are doing this the correct way.
No need to improve upon the wheel as you will only be going around in
circles. :)
 
M

Marshall Barton

Chad said:
I have a quick question:

I have a query that returns a 'Club' field and a 'Total' field which is
grouped by 'Club'. There are only 3 clubs available, but I would like to
specify the order they returned. For example, I have clubs A, B, C and I
would like them to be returned in the order B, C, A.

For now I am creating a new field and associating a number with each club,
and then sorting based off of that field. Is there another way to do this?
Or is the way I am accomplishing it the only way?


There may be other ways, but I think the use of a sort order
field is probably the best way to go.
 
R

Ron2006

Basically that is the way you will want to do it.

I am not sure how you are associating the number with the club name.
Perhaps the good way of doing it that allows for easy expansion is to
have a table of club names and part of that table is the Sort sequence
you want.

Then in yourQuery add that table and sort by that number.

This may be what you are doing, but you were not too specific how you
were associating the number with the name.

Ron
 

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