4 Replies Latest reply on May 8, 2016 11:23 AM by siplus

    ADDING RECORDS FROM DIFFERENT TABLES

    tweneboah

      Please i have four (4) tables namely:

      ....welfare payment table

      ....Tithe payment table

      .....Youth dues payment table and

      ....members table.

      please how can i add all the payments from tithe, welfare and youth dues payment table?

      Please any help will be much appreciated.

        • 1. Re: ADDING RECORDS FROM DIFFERENT TABLES
          siplus

          A field in members, calc, (will be unstored ofc) defined as

           

          TotalPayments = Sum(WelfarePayments::Amount) + Sum(TithePayments::Amount) + Sum(YouthDues::Amount) ?

           

          BTW I usually put such things in a popover, you have to click on a "show total" button that displays it to see the field's content, otherwise you are slowing down the Members database unnecessarily.

          • 2. Re: ADDING RECORDS FROM DIFFERENT TABLES
            erolst

            siplus wrote:

            A field in members, calc, defined as

            TotalPayments = Sum(WelfarePayments::Amount) + Sum(TithePayments::Amount) + Sum(YouthDues::Amount) ?

             

            That sounds like fun. Not.

             

            How about using a single Payments table, and a field for category (Welfare, Tithe or YouthDue)?

             

            With your current setup, you need to create a new table (but basically identical to the existing ones) whenever you introduce a new payment category, and must also modify the summing mechanism. With a single table, you add new category.

             

            Anyway, siplus's suggestion works (of course).

             

            tweneboah wrote:

            ADDING RECORDS FROM DIFFERENT TABLES

            Please don't use allcaps.

            • 3. Re: ADDING RECORDS FROM DIFFERENT TABLES
              tweneboah

              Good answers but how can i link the tables using ID'S

              • 4. Re: ADDING RECORDS FROM DIFFERENT TABLES
                siplus

                unfortunately, we don't know much about the existing data. The OP might have inherited an existing setup with thousands of clients and a superior order of magnitude regarding existing payments, or he might be developing right now the solution - in this case of course your advice is totally sound - nobody would create separate payment tables for cash, visa, mastercard, paypal etc. The all caps might hint into the latter