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

Pinting only first and last record 1

Status
Not open for further replies.

dkaf

Technical User
Mar 29, 2005
15
US
I am creating a report that will print vehicle odometer readings. My field is {Meter1}. I am defining it by date. I need to print only the first odometer reading and the last odometer reading. I then need to calculate and print the total mileage between the two.
 
Group by the auto (assuming that your doing multiple autos, you've stated nothing about the data here which is key to building a report...), then in the group header place this formula:

whileprintingrecords;
numbervar StartRead:= {table.meter1};

Then suppress the group header and the Details sections, and in the group footer place this formula:

whileprintingrecords;
numbervar StartRead;
{table.meter1}-StartRead

This will display the difference.

-k
 
You could probably just group by date and then create a formula for the group header or footer:

maximum({table.odometerreading},{table.date}) - minimum({table.odometerreading},{table.date})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top