Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Group Sorting Issue Post Reply Post New Topic
Author Message
FrederickMeyer
Newbie
Newbie


Joined: 15 Oct 2009
Location: United States
Online Status: Offline
Posts: 3
Quote FrederickMeyer Replybullet Topic: Group Sorting Issue
     Posted: 15 Oct 2009 at 3:09pm
Hello,

I am trying to sort groups, but am having difficulties with how to set it up.  I need to sort based on a category called "Acronym" which shows an alphanumeric course designation (it is for seminars that are generally 2-5 days in length).

I need to group the records by the acronym, but I need to sort the groups chronologically by the dates in which the seminars are run.

As it turns out, we sometimes run more than one class on a given set of dates.  I've been able to either group and sort by acronym (not in correct date order), or by date (then the grouping collapses all courses run on the same date into one).

Access seems to be able to do this, but I can't figure out how to do it in Crystal.

Thanks for any help you can offer!


Edited by FrederickMeyer - 15 Oct 2009 at 4:49pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 16 Oct 2009 at 6:36am
write a formula like:
totext({table.dateField}, "MM/dd/yyyy") + {table.Acronym}
 
this should group by date and description, and whenever either changes, it will change the group, as well as sort it, though your acronyms may interleave because of the date.  If so, you can do 1 of 2 things, 1) create a higher group based on acronym alone, or 2) reverse the order  of acronym and date in the above formula.  Oh, yeah, I forgot the important part, group on the formula instead of a table.field combination.
 
HTH
IP IP Logged
FrederickMeyer
Newbie
Newbie


Joined: 15 Oct 2009
Location: United States
Online Status: Offline
Posts: 3
Quote FrederickMeyer Replybullet Posted: 16 Oct 2009 at 9:22am
That worked!  Thank you!

I'm not really sure why it worked though (or, how).  What exactly does this formula do differently than grouping on either the acronym field or the date field?  I'm just trying to learn more about how Crystal works...

Thanks again!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 16 Oct 2009 at 2:30pm
The formula concatenates the date and the acronymn together.  In a group, when the group item changes, a new group is started.
 
aaa-03/16/2009
aaa-03/17/2009 are different groups, but if it was just acronym, they would be the same group since they are both in acronymn aaa. 
 
You could accomplish the same thing by group first by acronymn and then creating a second group by date.
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum