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

<b>How can I get the record with a latest date?</b>

Status
Not open for further replies.

Stella1209

Programmer
Feb 9, 2001
32
US
I need to print the record with a latest date (in a date field). What formula should I use to do that? I tried to use Maximum Function, but it seems like it works only for numbers. Any ideas?
Thanks,
Stella
 
I assume that you mean the latest date for each group of records (customer, etc. )

If all you need to do is print this record (not do totals using it) then:

1) Create a group so that all of that customer's records are in one group.
2) Place the fields you want to print on the Group Footer,
3) Sort the records within the group into ascending order based on the date.
4) Hide the details and Group Header. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Ken,
Thanks for your help, but it will not work in my case because I have to get totals.
Any other ideas?
Stella
 
You can use running totals (in V7 and V8) and set the evaluate to "once per group".

Crystal has no way of selecting only the latest record without returning all of the records to evaluate them. This will throw off totals, unless you use running totals. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
One note, running totals that evaluate once per group take the FIRST record of the group. So you have reverse my original post. Sort Descending, and put the fields to print on the Group Header. Hide the details and group footer. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top