1 Reply Latest reply on Mar 28, 2011 11:49 AM by philmodjunk

    Calculations between tables



      Calculations between tables


      I recently divided my huge database into multiple tables to make it more stable. Now the simplest calculations aren't working and it seems to be when I try to use fields in different tables.

      I have a schedule and am simply doing a calculation such as:

      task1 = task2 - (table::duration * 7)

      at this instance task1 and task2 are in one table and duration is in a related table

      the tables are related by a single common id code

      what do I need to do to make this work??

        • 1. Re: Calculations between tables

          If there is a one to one relationship between these two tables, this should work. If you have more than one record in the second table (where you defined the duration field), then you may not be referring to the record you thought you were in the calculation.


          If I have this relationship:

          Tasks::ID = DurationTable::ID

          and my current record in the "tasks" table has ID = 1

          And I have these records in "duration":

          ID     Duration
          1        5
          1        6
          1        8
          2        5
          3        4

          Then Table::Duration * 7 will evaluate to 35 for the current record. The records with durations of 6 and 8 cannot be accessed by this relationship.