Gossamer Forum
Home : Products : DBMan : Customization :

Re: Calculate field based on other fields

Quote Reply
Re: Calculate field based on other fields In reply to
Where you put the code depends on what you want to do with it. Is the amount going to be computed when the record is added? Will this amount be entered into a field in the database? Or is this just something you're computing as you print out the record?

I think you want to use if instead of while, especially if you're computing the value based on one record.

There are a couple of other syntax errors in your code. For one thing, you need to have

$rec{'Paid'}

instead of

$rec{'Paid'

The other problem is that you have no variable to hold, for example,

$both_fee - $rec{'Paid'}

You need something like

$balance = $both_fee - $rec{'Paid'}

However, I think we can make this code a little more compact if I have a little more understanding of what you intend to do.


------------------
JPD





Subject Author Views Date
Thread Calculate field based on other fields bboru 1452 Oct 9, 1999, 12:35 PM
Post Re: Calculate field based on other fields
JPDeni 1358 Oct 9, 1999, 2:14 PM
Post Re: Calculate field based on other fields
bboru 1359 Oct 9, 1999, 4:49 PM
Post Re: Calculate field based on other fields
JPDeni 1351 Oct 9, 1999, 5:58 PM
Post Re: Calculate field based on other fields
bboru 1354 Oct 10, 1999, 4:38 AM