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!

5 Most Recent Records by Date

Status
Not open for further replies.

deemat

MIS
Jan 20, 2006
24
US
I have a report that is grouped by type of call. Emergency, Routine, Urgent etc. Then grouped by the person who answered the call. What I need to do then is show the last five records in the detail section by the date the call was received. I am familar with the group sort but it only allows me to get the Top 5 based on a total which I am not using. I am using Crystal Reports 11.
 
i do not have crystal in front of me to test, but think you need to insert a summary (top N, N=5) on the call received date.
then suppress data that is not in the top N=5.
 
Do you mean a formula in the Section Expert of the Details section to get the Top N? Creating a summary only gives me the latest date of all the calls received in the footer. I am trying to see the last 5 records in the details section of the report. For example

Urgent
Joe Doe
3/7/11
3/5/11
2/27/11
2/1/11
1/31/11

 
If you insert a group #3 on the date field and then insert a summary (maximum) on the date field at the Date group level, it will activate the group sort, and you can choose topN = 5.

If you don't want to do that, you can insert a running total that does a count of any non-null field, evaluate for each record, reset on change of group: person. Sort the records by date descending, and then go into the section expert->details->x+2 and enter:

{#runningtotal} > 5

-LB
 
Thanks, used the insert group#3 and that worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top