2 Replies Latest reply on Oct 1, 2015 12:42 AM by erolst

    give back oldest date

    gilo

      Hi

       

      I have 2 tables, clients and rdv

       

      I use a layout based on clients, where a portal shows me all the rdv (meetings) for this client.

       

      I would like to create a kind of reminder, so I see, and I can make FM show me, when the next meeting should be planed. (+6 months)

       

      How can this be done? I need FM to set the field clients_nextmeeting to rdv_date + 186. This works if I have 1 meeting, but how to tell FM to take the latest date of all meetings and to add 6 month? Has anyone an idea on how to proceed?

       

      thx

        • 1. Re: give back oldest date
          richardsrussell

          Yup. Set up your portal so it's sorted chronologically in descending order. Do this by double-clicking on the box between Clients and RDV in the Relationships diagram and then specifying the sort order for the RDV side of the relationship:

           

          Box.jpeg

           

          Sort.jpeg

           

          The topmost date in your portal will then be the most recent meeting.

           

          Within your Clients table, create the Calculation field "Next Meeting" (type Date), = CDV::Date + 186. It will use the topmost "Date" value from your portal. Display "Next Meeting" wherever you want on your Clients screen, but probably somewhere near the CDV portal.

          1 of 1 people found this helpful
          • 2. Re: give back oldest date
            erolst

            No need to sort anything; use

             

            Min ( CDV::Date )

             

            to get the oldest related date.

             

            If you want to go ahead 6 months, rather than the arbitrary amount of 186 days:

             

            Let (

            o = Min ( CDV::Date ) ;

            Date ( Month ( o ) + 6 ; Day ( o ) ; Year ( o ) )

            )