cancel
Showing results for 
Search instead for 
Did you mean: 

calculate total from "DateDiff" number field

Former Member
0 Kudos

Hi,

in my report, I've made a DateDiff formula to calculate the time between the beginning of the first event on a day and the end of the last event from the same day ;

this returns a number field.

When I try to summarize this field in order to have the total time per month, Crystal Reports returns the error message "impossible to summariz" ?

In my report, the data is grouped first by month and then by date.

Any idea's how to get this done ?

Thanks,

Marc

Accepted Solutions (1)

Accepted Solutions (1)

former_member205840
Active Contributor
0 Kudos

Hi Marc,

This can be done using running totals, follow below steps :

Whileprintingrecords;

Numbervar tot:=0;  // place this formula on group header/

Whileprintingrecords;

Numbervar tot;  // place this formula on detail section.

Tot:=Tot+{@yourdatediff formula}

Whileprintingrecords;

Numbervar tot;  // place this formula on group footer to get group wise totals.

If you want to print grand total, not group wise totals then don't use first formula.

-Sastry

Former Member
0 Kudos

Hi Sastry,

this has indeed done the trick ; many thanks !

Best regards,

Marc

Answers (0)