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!

Selecting latest record by date field

Status
Not open for further replies.

malk

MIS
Dec 12, 2000
84
US
I have a database with multi records for each person. Each entry has a date with it. I want the report to only show the latest record for each person. How would I write this selection?
 
malk: Build a running total to find the maximum of date fro each person, You can then logically suppress any record where date<>running total David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Thanx, but I have a few issues:

1- Suppress just prints a blank report and leads to ugly reports.

2- I have to put this formula into every field on the report otherwise it prints.

3- The date field is no longer printing after the first time.

Any other suggestions?
 
Malk: Let's just re-visit things. If all you want is the latest record per person then group your report by person, sort your records into ascending date order and place the date field on the Person group footer line (you'll get just the latest date displayed for each person).

If however, you want to select other data based upon the latest date per person then my suggestion of building a running total of the maximum of the date and resetting per person will enable you to identify the latest date even without sorting them (you'll still have to group by person). This running total could then be used to select the appropriate record(s) as in:

if {Date_passed_exam} = {#RTotal0} then {Exam name} else &quot;&quot;

This would select the latest exam passed etc.. David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top