Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Finding last of each record for a given field


JoeDu

Recommended Posts

What I have is a few thousand records for a number of clients, and each client has dozens of records.

 

I'd like to find the last record for each client, and omit the rest, in a script.

 

This seems so simple yet I'm wrestling with the commands. Any help?

Link to comment
Share on other sites

Hopefully you have clients in one table and the "records" in another table.

 

Make a client table, viewed as a form, and put a portal to the related records. Sort the records by date (either ascending or descending).

 

Finally, loop through all of your clients with a script. Look at the portal last record (ascending sort) or first record (descending sort) to get the date of the last record.

Link to comment
Share on other sites

I'll try that, thanks!!!

 

Still getting used to portals and relationships. But yes, thankfully I had the foresight to create the client table separately, and the records table references fields from the client table.

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use