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

How to show more than just the last record in the footer section 1

Status
Not open for further replies.

MrGinoM

IS-IT--Management
Nov 5, 2010
2
US
Hello Everyone,

I am working on a report that is just driving me NUTs!!! Any help is appreciating.

This is a high level explanation with picture to help:

Data:

Table name: Dialysis Information
Patient name: Crayola, Red
Dialysis_ID (unique) Start_date End_date
1346 3/1/2010 0:00 4/6/2010 0:00
1456 10/11/2010 0:00 11/3/2010 0:00
1238 4/6/2010 0:00 8/5/2010 0:00
1145 8/5/2010 0:00 10/11/2010 0:00

I would like to show the last dialysis start date (max), but more important display the corresponding end_date – regardless if it is null

A solutions I’ve found to work: Sorting record by start date in ascending order and displaying start and end date.

But I wanted to get a more solid and intuitive solution -where if I created a running totals that happens to display a mid- answer of start-date: 4/6/2010 0:00 in the footer section and wanted to display its corresponding end_date: 8/5/2010 0:00 in this same section, how would I can I do this? The footer section only shows the last record in the table.
 
But under what condition would you be selecting a mid-range start date? Anyway, without sorting, you could use a variable like this:

whileprintingrecords;
datetimevar start;
datetimevar end;
if {table.startdate} = <some criteria> then
(
start := {table.startdate};
end := {table.enddate}
);

Then in the group footer, use separate formulas to display the results:

//{@displaystart}:
whileprintingrecords;
datetimevar start;

//{@displayend};
whileprintingrecords;
datetimevar end;

Add a reset in the group header in case of nulls:
whileprintingrecords;
datetimevar start;
datetimevar end;
if not inrepeatedgroupheader then(
start := datetime(0,0,0,0,0,0);
end := datetime(0,0,0,0,0,0)
);

-LB
 
In this report I wouldnt need to select a midrange date, but I wanted to at least have an idea if that possiblity arises.

Your help with this is appreciated lbass.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top