Crystal Reports 2008 running total using datediff returns only 1

146 views Asked by At

I have a running total set to count employees with less than 30 days between two events. While the report has groups, I have the running total set to never reset. I am using a formula in the Evaluate section that is as follows:

DATEDIFF("d",{Employee.DATE_Event1},{Employee.Date_Event2}) < 30. 

This running total returns 1 when placed in the report header and 1400 when placed in the report footer. 1 is far too low and 1400 is far too high. The requester wants the total in the report header. Thoughts?

1

There are 1 answers

0
Siva On

if you keep your formula in header.. it will display 1st record and if you place in footer then it will display last record.. that is how it works.. so you get 1 and 1400...

You are trying to display a value when it is not actually calculated because as the running total reaches the footer value then you will get the fully calculated value....

what you can do is create a sub report and place it in header and supress the sub report... Perform the same calculation that you do in the main report and pass the sub report value to main report and take one more section of header after sub report section and display there your value..

With this approach load on database and report will increase as you are performing the same operation twice