Announcement

Collapse
No announcement yet.

Calculating 2 Fields

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculating 2 Fields

    Is there a way of making a column(s) add up specific columns for each different row within a grid (or anywhere else)?

    An example is (for a soccer database):

    HomeFirstHalfGoals + HomeSecondHalfGoals this would be calculated for the HomeTotalGoalsScored column.

    AwayFirstHalfGoals + AwaySecondHalfGoals this would be calculated for the AwayTotalGoalsScored column

  • #2
    yes. create a new field and fill this with the sum in the onrecord event.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Albert is correct. You can make fields up, ones that are not actually part of the mysql table. Once you make your fields, you can do things like:

      {HomeTotalGoalsScored} = {HomeFirstHalfGoals} + {HomeSecondHalfGoals}; // I am assuming HomeTotalGoalsScored is a field you added for display in the grid, but is not in the original table

      I do this with displaying tax, where I use a global [taxrate] and the {subtotal} field.
      {tax} = [taxrate] * {subtotal};

      Good luck,
      Jamie

      Comment

      Working...
      X