4 Replies Latest reply on Apr 11, 2014 1:28 PM by philmodjunk

    Combining data from two tables in a report

    john9210

      Title

      Combining data from two tables in a report

      Post

           FM 12 Adv. I would like to create a report that contains similar fields in two tables. For example, I have the fields Table1::Names1 and Table2::Names2. I would like create a sorted list of the names (in a column) from both tables in a single report.

        • 1. Re: Combining data from two tables in a report
          philmodjunk

               Then you will need to combine the data from these two tables into a single table for purposes of this report. The fact that you need to do this may indicate that you should be using a single table instead of two in the first place.

               But Import Records can be used to set up such a "report table" for use in your report.

          • 2. Re: Combining data from two tables in a report
            john9210

                 No, I really need two separate tables. It's just that one of them has some data that is useful to print out in a report with data from the other table. It's not worth the effort of combining the tables into one.

            • 3. Re: Combining data from two tables in a report
              philmodjunk

                   One way or the other, you need a combined table of records if you want a single sorted list of names from both tables. You can do this as a permanent design change or you can set up a third table into which you use import records to copy the data from the original two tables solely as a means of making this report possible. You can delete the records from this third table when you are finished with your report.

                   And when you say "it's too much trouble", please keep in mind how much trouble it is to do what you need with your data when the records are not in a combined table and perhaps you will change your mind about replacing the separate tables with a single combined table...

              • 4. Re: Combining data from two tables in a report
                philmodjunk

                     If the number of names in each table that you need to combine in this list is modest and you are using FileMaker 12 or newer, you may be able to set up a large, multiple row calculation field that uses ExecuteSQL with the Union keyword to combine the two sets of names...