Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to sort a group header

Status
Not open for further replies.

RenaG

Programmer
May 3, 2011
132
US
I am running Crystal Reports 10.

The report consists of 2 group headers:
Group 1 - Location
Group 2 - Patient ID
The detail is suppressed
On the group 2 line I also display the appt date and patient name
For example:
Code:
LOC1
22 Apr  2345  Edna Jones
8 Apr   8576  Ruth Smith
13 Apr  4827  Jan Black
LOC2
19 Apr  7678  Betty Brown
26 Apr  1124  Cindy Cooke
2 Apr   9879  Mary Doe
I would like to sort the second group header by date. Is there a way to do that?

TIA
~RLG
 

Groups are sorts so your data will be ordered by location and then patient ID. You may not need the group on patient ID at all and could replace it with a sort on the date or change the group to be by the date. I'm not really sure what you are trying to do.
 
Insert a maximum on date at the Patient ID level. Then go to report->group sort->Patient ID group->select maximum of date as the group sort field, and then select ascending or descending as desired.

-LB
 
TeyBrady -

There can be more than one record/patient so I have to group by patient so that I only see one. I hope that helps to explain it better.

LB -

I created a formula - Maximum ({ApptDate}) - and put it on the PatientID group header. When I go to Report the group sort expert is greyed out. What am I doing wrong?

Thanks
~RLG
 
No, don't create a formula for the summary--instead, you have to right click on the date in the detail section->insert summary->maximum. This is what activates the group sort.

On a separate note (irrelevant to the group sort), your formula would have returned the maximum date for the entire report. In a formula, you have to add the group condition:

maximum({table.date},{table.groupfield})

-LB
 
Thank you LB. I can always count on you to have the answer!

And yes, the max date did show the max for the entire report :).

~RLG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top