Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Running total - last record counted double Post Reply Post New Topic
Author Message
Macavity
Groupie
Groupie


Joined: 24 Sep 2012
Online Status: Offline
Posts: 93
Quote Macavity Replybullet Topic: Running total - last record counted double
     Posted: 20 Sep 2013 at 4:02am
Hi,

I have a runningtotal on a number of days. I put it in the group footer, it counts the last number of days twice. There are no suppresses and no conditions on the formula.

Any ideas ?


IP IP Logged
Macavity
Groupie
Groupie


Joined: 24 Sep 2012
Online Status: Offline
Posts: 93
Quote Macavity Replybullet Posted: 23 Sep 2013 at 3:44am
I created a formula : @total
whileprintingrecords;
numbervar total:= total + @nrdays(this is a datediff)

still counts last record double, added not onlastrecord, still counts double

created a new formula
@remembernrdays : if onlastrecord then @nrdays else 0
@newtotal : @total - @rememberlastnrdays

this gives the correct total.

Is this a bug ?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 24 Sep 2013 at 5:17am
since I've never had this happen...
what I suspect is that the formula is being called in a group footer, and the report footer...or something like that so that the amount is being incremented one extra time.

IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum