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!

Getting the max(document) from Subreport

Status
Not open for further replies.

gator88

IS-IT--Management
Nov 15, 2007
4
I currently have a Report that has a subreport that I want to show the most recent vitals docutment for the client that is reported on in the main report. And for that Vital not to report after the main report date.
 
In the main report, group by client and insert a subreport into the client group header or footer. Link the sub to the main report on client and on the main report report end date (Let's assume it is a parameter {?EndDate}). In the sub, go into report->selection formula->record and change the selection formula so that the date selection looks like this:

{table.date} <= {?pm-?EndDate} and
{table.clientID} = {?pm-table.clientID}

Then still in the sub, go to report->selection formula->GROUP and enter:

{table.date} = maximum({table.date})

This will return the most recent record for the client that is on or earlier than the main report end date.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top