1 Reply Latest reply on Oct 28, 2009 10:02 AM by TSGal

    Next Related Record, is this the most efficient way?



      Next Related Record, is this the most efficient way?


      Ok in my database i have jobs, and with each job there are site visits, when listing all of the jobs i need to be able to view the next site visit and the reason associated with it, the way i have gone about it is...


      create an extra site visits table in the data base, set a global field to get(currentdate)

      create the relationship as normal but include date>get(currentdate)

      sort related records ascending


      in the list of jobs have a related field to the site visits reason, it shows the next one, as the dates are ascending and only showing the ones after today


      is this the most efficient way? got the feeling there should be something a tad easier?


      Thanks in advance

        • 1. Re: Next Related Record, is this the most efficient way?



          Thank you for your post.


          Instead of creating an extra site visits table, just create a relationship from Jobs into a second table occurrence of Site Visits, with the relationship set up as you described.  In the Relationships diagram, click on new table occurrence, select the Site Visits table, and you will see "Site Visits 2".  Set up a new relationship with Jobs and Site Visits 2 including the additional criteria "date > Get (CurrentDate)".  Then, include a portal into Site Visits 2 to view the site visits that occur after today.


          If you need clarification for the above steps, please let me know.



          FileMaker, Inc.