6 Replies Latest reply on Jan 30, 2012 8:20 AM by comment

    Filtering by current date from parent to child related table.

    tcenguyen

      Hi all,

      I am new to FileMaker and in the processing of learning it. I love it, however I got stuck how to make make it work they way I needed it to be.

       

      I have two tables , Activity tabble and Supplement table.

      1. Activity table record all the activity that user enter his or her activity by TEXT, I do have __ActicityID as the Primary key for it, Activity as TEXT so use can type; and Date and Time field with Auto Created and Can not modify.

      2. Supplement table is the very much like the Activity table but with ONE additonal field format as TEXT so user can enter the Supllement to the ACTIVITY ID +

       

      Question: How Can I display only record that Created as today + ::Activity or Current date in the Supplement Table, so user can select it the Layout of the Supplement.

       

      I have try to use the gdate as global and the function of get (currentdate) but I am not sure I did it corectly.

       

      Please advice.

       

      Thanks

        • 1. Re: Filtering by current date from parent to child related table.
          RayCologon

          tcenguyen wrote:

          Question:  How Can I display only record that Created as today + ::Activity or Current date in the Supplement Table, so user can select it the Layout of the Supplement.

           

          Hi tcenguyen,

           

          Rather than using a global field, I suggest you create an unstored calculation field with a result type of date and with the formula specified as Get(CurrentDate), then use that as a match field for a relationship to your Supplement table.

           

          You will need to set up the relationship so it matches the unstored calculation in the Activity table with a date field in the Supplement table that auto-enters the creation date - and you will need to add a second pair of match fields to the relationship to also match the ActivityID field in both tables, like this:

           

          FilterByDate.png

          The order of the two match pairs (predicates) for the relationship doesn't matter, but you'll need them both to ensure the relationship will address supplements for the current activity *and* for the current date.

           

          Regards,

          Ray

          ------------------------------------------------

          R J Cologon, Ph.D.

          FileMaker Certified Developer

          Author, FileMaker Pro 10 Bible

          NightWing Enterprises, Melbourne, Australia

          http://www.nightwingenterprises.com

          ------------------------------------------------

          • 2. Re: Filtering by current date from parent to child related table.
            comment

            tcenguyen wrote:

             

            Question:  How Can I display only record that Created as today + ::Activity or Current date in the Supplement Table, so user can select it the Layout of the Supplement.

            Could you clarify what exactly are you trying to do? I can't decipher what you mean by "record that Created as today + ::Activity or Current date".

            • 3. Re: Filtering by current date from parent to child related table.
              tcenguyen

              Hi Michael,

              There are two tables.  Activity as the Parent table with the __PK_ActivityID and the _FK_ActivityID for the Supplement table. So these two table is now related.  On The Activity Table has two fields that I need to display in the Supplement Layout.

              1. Date ( Date that created when the record is created at the Activity table), and the Activity_Description that user input as Text there.

              2. Supplement table needs to display All the records that are created on Activity table by Date Created as of today not the pass.  User then select that record, then input the Supplement Description in the Supplement table/layout.

               

              I shope my explaination is clear enough for you.

               

              Thanks

              • 4. Re: Filtering by current date from parent to child related table.
                comment

                No, I am afraid I am still confused, especially by this:

                tcenguyen wrote:

                 

                2. Supplement table needs to display All the records that are created on Activity table by Date Created as of today not the pass. 

                If you are on a layout of the Supplements table, you are seeing supplement records. You can perform a find to show only supplement records that were created today. Or you can perform a find to show only supplement records whose parent record in Activities was created today. In both cases, you will be showing only records that already exist.

                 

                What I don't understand is why would you have existing supplement records with nothing in the Supplement Description field.

                • 5. Re: Filtering by current date from parent to child related table.
                  tcenguyen

                  Hi Michael,

                  I wanted to base on the records that created by date on the Activity table, so that I can create a new record , which call supplement. to the existing record on the Activity table, but the new record is save in the Supplement. 

                   

                  show by date from the parent, so that not all the record are shown just by Today DATE.

                   

                  !. New record in the Supplement is associated with the Parent table ( Activity). 

                   

                   

                  Thanks

                  • 6. Re: Filtering by current date from parent to child related table.
                    comment

                    I think you want to be on a layout of Activities, perform a find for activities that were created today, and enter new supplement records through a portal on the same layout.