I have a list of client records with a start-date and an end-date. In some cases there are multiple lines for a client, identical except for start-date and end-date. I need to somehow either concatenate them into one client record which contains the minimum start-date and the maximum end-date from each of those client’s records, or create a new client record for each client with the minimum start-date and the maximum end-date. All other data can be discarded in the process.
For example, I start with:
JohnDoe, startdate: 1 Jan 2024, enddate: 1 August 2024
JohnDoe, startdate: 3 Mar 2024, enddate: 31 August 2024
JohnDoe, startdate: 3 Mar 2024, enddate: 15 Dec 2024
DavidSmith, startdate: 1 Feb 2024, enddate: 15 Oct 2024
DavidSmith, startdate: 3 Mar 2024, enddate: 18 Oct 2024
And I want to end up with:
JohnDoe, startdate_min: 1 Jan 2024, enddate_max: 15 Dec 2024
DavidSmith, startdate_min: 1 Feb 2024, enddate_max: 18 Oct 2024
I have managed to create a really intricate and clunky solution which kinda works - but I would like a slick reliable solution which can cope with multiple clients each with multiple dates.
Any ideas?




