1 of 1 people found this helpful
In the relationship graph you can specify a sort order. Sort on your date field. If you put the related fields on to the layout (not in a portal) that should give you the record you want.
Hello, Fredo. The traditional way to do this is to sort the relationship. In the Relationships Graph, double-click on the relationship line between the two table occurrences. Check the "Sort records" checkbox on the child side of the relationship (in your case, LABTESTS):
Now, whenever you refer to LABTESTS::date, it'll automatically be the first record in sort order (however you sort it).
You can also use ExecuteSQL to construct a query that extracts the first row using a combination of ORDER BY and FIRST.
Thank you, David and Mike. Your suggestions were most helpful.