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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return the most recent record in a group

Status
Not open for further replies.

javedi

Technical User
Apr 30, 2007
196
GB
Hi

Can someone help me with a report i'm working on to return the most recent record in a group based on a resolved date. I have tried the maximun(date) but it throws errors.

Any help would be appreciated.

Ta,
Javedi
 
If you group by account (or whatever) and then use Report > Record Sort Expert to sort by "resolved date", the most recent should be the last, or first if you sort descending.

If you move details to the group footer, that will be the details you want. Suppress the group header and detail lines, right-click for this option.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Hi Madawc,

The problem is that I do not want the multiple records showing at all in the detail. At the moment if a incident was resolved twice then it appears twice in the detail, i'd liek to only show the most recent record. Will your way work for this scenario?

Thanks,
Javedi
 
Hi Javedi,

If you follow the instructions from Madawc you will find that the final record for each group based on date will be shown (check that you have grouped appropriately (e.g. date group sort based on seconds not day)).

If two events occur in the same second then expect multiple records in that instance in which case you may need to further group by job number / incident number or some other form of measure.

x = not shown

xGroup Header
x-Date Header
x--Details
-Date Footer (Most recent date for the group shown here)
xGroup Footer

'J

CR8.5 / CRXI - Discovering the impossible
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top