I am using Crystal 8.5 with an Oracle 9 database. I am having trouble with a formula which is carrying data into the footer and casuing my result to be inaccurate.
The report groups all records from one peice of equipment for a particular date range of workorders.
The first formula is placed in the details and suppressed, it is: Time between last failure
if ({WORKORDER.ACTSTART} >= previous({WORKORDER.ACTFINISH}))then((DateDiff ("n", previous({WORKORDER.ACTFINISH}),{WORKORDER.ACTSTART} ))/60)
This just establishes whether or not the workorder started before the last one was finished.
The next formula (placed in details)is: @Count Workorders
if {@Time between last failure} > 0
and {WORKORDER.WORKTYPE} = 'EM'
then 1
This counts the workorder as a failure if the workorder started after previous one and it is a worktype EM.
Last formula (placed in group footer): @sum workorders
WhilePrintingRecords;
numbervar countwo:=tonumber({@Count Workorders});
numbervar tothrs:= tothrs + countwo;
Since the summary function does not work on @Count Workorders, this was the only way to display the total count of failures in that particular date range.
When the last record in the report is a CM (<> EM) the report is accurate. When the last record in the report is an EM, it counts one more record. I placed a copy of
@Count Workorders in the footer and it looks as though when the last record is an EM, it is counting the footer as another record. How do I limit @sum workorders to not count the data in the footer as a record??
The report groups all records from one peice of equipment for a particular date range of workorders.
The first formula is placed in the details and suppressed, it is: Time between last failure
if ({WORKORDER.ACTSTART} >= previous({WORKORDER.ACTFINISH}))then((DateDiff ("n", previous({WORKORDER.ACTFINISH}),{WORKORDER.ACTSTART} ))/60)
This just establishes whether or not the workorder started before the last one was finished.
The next formula (placed in details)is: @Count Workorders
if {@Time between last failure} > 0
and {WORKORDER.WORKTYPE} = 'EM'
then 1
This counts the workorder as a failure if the workorder started after previous one and it is a worktype EM.
Last formula (placed in group footer): @sum workorders
WhilePrintingRecords;
numbervar countwo:=tonumber({@Count Workorders});
numbervar tothrs:= tothrs + countwo;
Since the summary function does not work on @Count Workorders, this was the only way to display the total count of failures in that particular date range.
When the last record in the report is a CM (<> EM) the report is accurate. When the last record in the report is an EM, it counts one more record. I placed a copy of
@Count Workorders in the footer and it looks as though when the last record is an EM, it is counting the footer as another record. How do I limit @sum workorders to not count the data in the footer as a record??