Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create running total with positive and negative numbers

Status
Not open for further replies.

Snakedog12

Technical User
Jun 29, 2006
12
US
Hello,

I am trying to create a report that shows the totals of all checks sent to a supplier. Some of the checks have credits which show up as negative. But, the running total adds these amounts instead of subtracting. How do you get the running total to subtract the credit amount instead of adding it?

Thanks!
 
SnakeDog,

I am not sure how you are currently calculating your Running Total. I would try adding a catch such as:

Code:
[blue]Shared NumberVar[/blue] RunningTotal;
[blue]IF[/blue] {Table.CheqAmount} >= 0 [blue]THEN[/blue]
     RunningTotal:=RunningTotal + {Table.CheqAmount};
[blue]ELSE[/blue]
     RunningTotal:=RunningTotal - {Table.CheqAmount};

Not sure if this will help, if not please post information such as your report schematic, formulae used, Crystal & Database versions, etc.

Thanks,


Mike
______________________________________________________________
[banghead] "It Seems All My Problems Exist Between Keyboard and Chair"
 
i got it! I just did

if {inv type}="dm" then {inv amt}*-1 else {inv amt}

Thanks for the help though!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top