Jump to content

Last record in subset


This topic is 2278 days old. Please don't post here. Open a new topic instead.

Recommended Posts

FM 12 Adv. Finding the latest record in a found set is straight forward, however I would like to identify the last record in each subset of a found set. For example, suppose the records have name and date fields.  A found set contains 12 records: 4 John records, 5 Mary records, and 3 Fred records. I would now like to loop through the found set and identify the latest record (by date) for John, the latest record for Mary and the latest for Fred. I would then create a new found set of only these 3 records.

Link to comment
Share on other sites

2 hours ago, john9210 said:

I would then create a new found set of only these 3 records.

Why would you need a new found set? Use a sub-summary part to display data from the latest record in a group, and remove the body part from the layout to "hide" the other records.

Link to comment
Share on other sites

Thanks. That worked. One question if i put a field in the subsummary part (not a summary field) which record does it display the data from? The first or the last record in the group?

Link to comment
Share on other sites

16 minutes ago, john9210 said:

if i put a field in the subsummary part (not a summary field) which record does it display the data from? The first or the last record in the group?

If it's a leading subsummary, then from the first. If it's trailing, then from the last.

Link to comment
Share on other sites

This topic is 2278 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.