1 Reply Latest reply on Nov 29, 2016 4:22 PM by philmodjunk

    Find and show a specific date of a class



      I hope someone can give me a tip on how to bring the latest date of a specific class (happening more that one time in a year) into the students layout.

      let's say we need to have a current BLS date for nurses attended several BLS classes last years, but we need to get the latest date for them.

      they need to have a current BLS date (based on the last BLS class they have attended) and then an expiration date (two years after the current date).

      I hope this is clear to understand, sorry for my weak English wordings.

      thank you

        • 1. Re: Find and show a specific date of a class

          There are multiple ways to do this and the best method can depend both on your skills/preferences and the design of your solution.


          Key facts that can help. You can find or use a relationship to match to all BLS records. you can then sort those records by sorting the found set or the relationship to make the record with the most recent date either the first record or the last record in this group. If you perform a find, you can then go to either the first or last record to get this date. If you use a relationship, directly referencing this date field through the relationship will reference the first related record while the Last ( RelatedTable::DateField ) will return the date of the last related record. In both cases, the sort order that you use determines whether you want the first or the last record.


          In addition, Max ( relatedRecord::Date ) will return the most recent date from a set of related records.


          Finally, you can use ExecuteSQL to get this most recent date from a set of records in your solution.