Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: calculate sum Post Reply Post New Topic
Author Message
veronika
Newbie
Newbie


Joined: 07 Feb 2008
Location: Canada
Online Status: Offline
Posts: 2
Quote veronika Replybullet Topic: calculate sum
     Posted: 07 Feb 2008 at 7:05pm
I need to calculate sum in datetime group but not all records, only those records that one of the fields are = "55". I created formula:
 
DateTimeVar prevTime;
NumberVar Result;

If ({ado.RecordType}) = "55" then
  Result:= Result + 1;
If ({ado.localT}) = prevTime then
 Result:=0
else
 Result:= Result;
prevTime = {ado.localT};
Result;
 
but its not calculate in time group. What I am doing wrong?
 
Thanks
IP IP Logged
krpmsit
Newbie
Newbie
Avatar

Joined: 06 Feb 2008
Online Status: Offline
Posts: 21
Quote krpmsit Replybullet Posted: 08 Feb 2008 at 4:15am
I thing you have declared as a local variable.
Each time, it will set to "0" (zero).
 
Try as a global variable.
 
 
Regards
K. Rajapandian
IP IP Logged
veronika
Newbie
Newbie


Joined: 07 Feb 2008
Location: Canada
Online Status: Offline
Posts: 2
Quote veronika Replybullet Posted: 11 Feb 2008 at 4:44pm
yes, thanks, thats working!
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