sorting

S

Steiner

How do i customize a sort in Access 2002, if I want to have a different order
than just accending and descending. Is that possible. I have made a
make-table query and then I calculed a sum and appended it to the tabe. I
now want to make a report with the values of each product and the totals at
the bottom but sort accending and descending does not meet my needs
 
J

JackP

How exactly do you want to sort?

You can only sort in two ways - ascending or descending.
However, if the sort you want is more complicated, you can generate a
ranking, and then sort on that.

For example
Rank :Iif([Position]="Chairman",1,iif([Position="Director",2,3))

this would give the chairman a rank of 1, directors a rank of 2 and everyone
else a rank of 3.
I would then sort by RANK ascending followed by surname ascending. This
would give me a seniority sort with a surname sort within that.

If that's not the sort of thing you're after, let me know what you want to
do and I'll try to help.
 
M

Markus Stahr

Test from Microsoft

JackP said:
How exactly do you want to sort?

You can only sort in two ways - ascending or descending.
However, if the sort you want is more complicated, you can generate a
ranking, and then sort on that.

For example
Rank :Iif([Position]="Chairman",1,iif([Position="Director",2,3))

this would give the chairman a rank of 1, directors a rank of 2 and everyone
else a rank of 3.
I would then sort by RANK ascending followed by surname ascending. This
would give me a seniority sort with a surname sort within that.

If that's not the sort of thing you're after, let me know what you want to
do and I'll try to help.
--
A laugh, a smile, and a pint of beer.


[QUOTE="Steiner"]
How do i customize a sort in Access 2002, if I want to have a different order
than just accending and descending. Is that possible. I have made a
make-table query and then I calculed a sum and appended it to the tabe. I
now want to make a report with the values of each product and the totals at
the bottom but sort accending and descending does not meet my needs
[/QUOTE]
 
S

Steiner

well i guess i want to do a more compicated sort then, basically i have
products which i want to sort in a particular order, each of these products
are in all repective countries and I want the order of the products to be the
same in all countries if i was sort by assending and descending it would be
ok but i want to have this specific order due to the fact that when i make
a report the information has to be organised in this specific order. So do i
still need to use rank or is this not possible i hope that this is clear
and if i do need to type in the code could you tell me where thank you
so much for your help
love the quote by the way
laurent
 
K

KARL DEWEY

This I did not test. Build a table with two fields - NUM and SortItem.
Number the SortItem in the order you want.
In your query link the two tables on the SortItem and use the NUM field
ascending.
 
K

KARL DEWEY

TESTED.

KARL DEWEY said:
This I did not test. Build a table with two fields - NUM and SortItem.
Number the SortItem in the order you want.
In your query link the two tables on the SortItem and use the NUM field
ascending.
 
S

Steiner

so how would i garentee a ranking as the products are the same in ach
country troughout

JackP said:
How exactly do you want to sort?

You can only sort in two ways - ascending or descending.
However, if the sort you want is more complicated, you can generate a
ranking, and then sort on that.

For example
Rank :Iif([Position]="Chairman",1,iif([Position="Director",2,3))

this would give the chairman a rank of 1, directors a rank of 2 and everyone
else a rank of 3.
I would then sort by RANK ascending followed by surname ascending. This
would give me a seniority sort with a surname sort within that.

If that's not the sort of thing you're after, let me know what you want to
do and I'll try to help.
--
A laugh, a smile, and a pint of beer.


[QUOTE="Steiner"]
How do i customize a sort in Access 2002, if I want to have a different order
than just accending and descending. Is that possible. I have made a
make-table query and then I calculed a sum and appended it to the tabe. I
now want to make a report with the values of each product and the totals at
the bottom but sort accending and descending does not meet my needs
[/QUOTE]
 
Top