Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Adding variable to itself Post Reply Post New Topic
Author Message
homeboybgd
Newbie
Newbie


Joined: 17 Apr 2012
Online Status: Offline
Posts: 4
Quote homeboybgd Replybullet Topic: Adding variable to itself
    Posted: 17 Apr 2012 at 11:39pm
I use Crystal Reports XI and I have a problem.Can anyone help me?
In my report i have fields "depts" "claims" and i want to create column "balance" where "balance = balance - depts + claims" for each record
i have variable balance = 5000 that is some previous balance

   depts    claims    balance
   1000     500       4500
   2000     0        2500
   1500     1000      2000

But i can't do this in formula editor...
how to add variable to itself?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 Apr 2012 at 3:34am
why not?
 
shared numvarvar balance;
balance := balance + balance;
 
or
balance := balance + {table.field}
 
do it all the time.... Were you using just the '='?  That is the comparator operator, you want to use ':=' this is the assignment operator.
 
HTH
IP IP Logged
homeboybgd
Newbie
Newbie


Joined: 17 Apr 2012
Online Status: Offline
Posts: 4
Quote homeboybgd Replybullet Posted: 24 Apr 2012 at 12:11am
balance is formula field. I don't have field in table, i need to calculate this field from report
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.