Search for the Closest Matching Record within the Group — From SQL to SPL #9

Problem description & analysis:
The table mytable in the MS SQL database has one ConfirmationStarted and multiple Closed statuses for each ID.Task: Now we need to find the record closest ...