1 Reply Latest reply on Apr 9, 2012 11:05 AM by philmodjunk

    syntax for Sum function

    KeithNordyke

      Title

      syntax for Sum function

      Post

      I have a table called "fees" that is related by client number to the client's table.  I have entered enough data to know that the fees table is capturing correctly the fees entered.  There are often numerous fee payments per client.  Other than the key field, there is a date field and a field called fee.   I created a field in the fees table that is called total_fees and it is a calculation table that is designed to add the fees for the client to let me know wat has been paid total.  I am using the fees table in a portal if that makes any difference.  The calculated field is not returning the sum of the fees but seems to be capturing only the smallest amount paid.  For example, for client "A" the fees table may have 1/1/12 and a fee of 100.00.  Thenext entry for that client would be 2/15/12 and fee of 1000.00.  The calcualted field shows the the 100.00 and not the correct number of 1100.00.  Ideas?  Correct syntax?

        • 1. Re: syntax for Sum function
          philmodjunk

          If you are going to use Sum, define the calculation field in the client's table, not the fees table. It's syntax would be:

          Sum ( Fees::FeeAmountField )

          If must evaluate from the context of Clients in order to display the correct value.

          You can also use a summary field defined om tje fees table to show the same total, but if you are editing fees in the portal to that table, the calculation field using sum will update more smoothly than the summary field from fees.