G
Guest
In Sorting & Grouping how can I set the Sort Order for the field [Rotation]
so that the values sort:
None
Some
All
Thanks!
so that the values sort:
None
Some
All
Thanks!
Duane Hookom said:IMHO the pure method is to add a field to your table of unique rotations that
describes the order:
tblRotations
Rotation SortOrder
None 1
Some 2
All 3
You can then add this table to your report's record source and sort by the
SortOrder field.
A much less flexible method is to set your Sorting and Grouping expression to:
=Instr("None Some All", [Rotation])
--
Duane Hookom
Microsoft Access MVP
JohnLute said:In Sorting & Grouping how can I set the Sort Order for the field [Rotation]
so that the values sort:
None
Some
All
Thanks!
JohnLute said:Hi, Duane!
I went with the less pure method. The field will only ever have 1 of the 3
possible values so I threw flexibility out the window.
How could I have found "Instr" if not here? I can never seem to find HOW to
code something in the Help files or Access books.
--
www.Marzetti.com
Duane Hookom said:IMHO the pure method is to add a field to your table of unique rotations that
describes the order:
tblRotations
Rotation SortOrder
None 1
Some 2
All 3
You can then add this table to your report's record source and sort by the
SortOrder field.
A much less flexible method is to set your Sorting and Grouping expression to:
=Instr("None Some All", [Rotation])
--
Duane Hookom
Microsoft Access MVP
JohnLute said:In Sorting & Grouping how can I set the Sort Order for the field [Rotation]
so that the values sort:
None
Some
All
Thanks!
Allen Browne said:The simplest solution would be to create a table with 2 fields, and populate
it with 3 records:
RotationNum Rotation
1 None
2 Some
3 All
You can now include this table in the report's query, and sort on
RotationNum.
If that is not possible, you could add a calculated field to the report's
source query use Switch() or nested IIf() expressions to generate the
sorting number (1, 2, or 3.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
JohnLute said:In Sorting & Grouping how can I set the Sort Order for the field
[Rotation]
so that the values sort:
None
Some
All
Thanks!
expressions. Quickly filter out the stuff that might not pertain while
returning stuff that might help.
I wish I had $10 for every time a client stated "The field will only ever
have 1 of the 3 possible values" ;-) I prefer to maintain data rather than
expressions.
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.