Group ordering on reports

K

Kevin C Niven

In my database you can place a given record in AGroup, BGroup, CGroup,
etc. or you can specifically indicate [NoGroup].

My problem is that I alphabetically group reports by Group
(ascending). I want [NoGroup] last, but of course it comes first. If
I remove the square brackets, it gets ordered directly after MGroup,
which is also wrong.

How can I make it such that [NoGroup] comes as the last group, while
keeping the other groups in ascending alphabetical order?

Many thanks,
Kevin
 
D

Duane Hookom

You can use an expression in the sorting and grouping dialog.

I would probably have a table of Group values with a column that identifies
the order to display. If you don't want to add [noGroup] to the table, you
could sort/group on the expression:
=Nz([OrderToDisplay],99999)
Another solution would be
=IIf([GroupField]="[NoGroup]", "ZZZZ", [GroupField])
 
M

Marshall Barton

Kevin said:
In my database you can place a given record in AGroup, BGroup, CGroup,
etc. or you can specifically indicate [NoGroup].

My problem is that I alphabetically group reports by Group
(ascending). I want [NoGroup] last, but of course it comes first. If
I remove the square brackets, it gets ordered directly after MGroup,
which is also wrong.

How can I make it such that [NoGroup] comes as the last group, while
keeping the other groups in ascending alphabetical order?


Try sorting on an expression instead of just the field:

=IIf(thefield<>"[No Group]", thefield, "zzz" & thefield)
 
J

John Harrington

Kevin said:
In my database you can place a given record in AGroup, BGroup, CGroup,
etc. or you can specifically indicate [NoGroup].
My problem is that I alphabetically group reports by Group
(ascending).  I want [NoGroup] last, but of course it comes first.  If
I remove the square brackets, it gets ordered directly after MGroup,
which is also wrong.
How can I make it such that [NoGroup] comes as the last group, while
keeping the other groups in ascending alphabetical order?

Try sorting on an expression instead of just the field:

=IIf(thefield<>"[No Group]", thefield, "zzz" & thefield)

Thanks for the suggestion. That worked.


Kevin
 

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