Hi,
I'm querying a database for workflow data (accounting data) that can be updated as often as monthly if the specific account/location is still active. The database stores all of the data (aka stores the same account data for May, June, July etc) and I want to be able to to take the most recent data point for each account/location, whether it was this month or 3 years ago. I currently have a sort and sample combination to get me this data, but I am wondering if there is a better way to do this?

If I want to make this an analytic app in the future so that users can check account information, would it be better to use a workflow constant for a date and use that as a reference for the most recent data? I ask bc my workplace has a workflow from a Big 4 consultant and it utilizes workflow constants, I'm just not sure if that is the best way to move forward.
Any guidance is appreciated!!