I am creating a report where I have to get the difference between two numbers (Number - Next(Number)) and then show the minimum result.
I am using Crystal 11 connecting to sql database.
I get all the records from a single Database Field called (as an example) Hole.Time. The field is sorted by Descending values. The values are whole numbers. An example of what I would be pulling in is (30,25,20,19,15,15,10,10,5,0) No grouping necessary that I can tell.
Here is what I have so far with the research I have done.
//{@MinResult} Placed in the Report Header a (RH-a)
WhilePrintingRecords;
NumberVar Min :=0;
//{@MinDelayTime} Placed in the Details section
WhilePrintingRecords;
NumberVar Min:={ShotTimingDetail.DeckFiringTime}-(NEXT({ShotTimingDetail.DeckFiringTime}));
//{@MinDelayTimeResult} Placed in the Report Footer a
WhilePrintingRecords;
NumberVar Min;
Min;
The report shows the difference between the two records correctly in the details section. What I need is to show the minimum value from that list of differences.
If I try to use Minimum({@MinDelayTImeResult}) or anything like it I get the "cannot summarize field" error.
I have seen many posts on how to get the Sum of formulas but none for getting the Minimum result.
Any help is greatly appreciated.
I am using Crystal 11 connecting to sql database.
I get all the records from a single Database Field called (as an example) Hole.Time. The field is sorted by Descending values. The values are whole numbers. An example of what I would be pulling in is (30,25,20,19,15,15,10,10,5,0) No grouping necessary that I can tell.
Here is what I have so far with the research I have done.
//{@MinResult} Placed in the Report Header a (RH-a)
WhilePrintingRecords;
NumberVar Min :=0;
//{@MinDelayTime} Placed in the Details section
WhilePrintingRecords;
NumberVar Min:={ShotTimingDetail.DeckFiringTime}-(NEXT({ShotTimingDetail.DeckFiringTime}));
//{@MinDelayTimeResult} Placed in the Report Footer a
WhilePrintingRecords;
NumberVar Min;
Min;
The report shows the difference between the two records correctly in the details section. What I need is to show the minimum value from that list of differences.
If I try to use Minimum({@MinDelayTImeResult}) or anything like it I get the "cannot summarize field" error.
I have seen many posts on how to get the Sum of formulas but none for getting the Minimum result.
Any help is greatly appreciated.