Hi Dwain,
Your workout was really helpful and of course i will be switching to your sample as there is no need of temp tables to hold the data. I was extra cautious and tried to get the IDcompAFR from temp table. By the way, your solution is clean and short.
I will be testing it with multiple scenario and start using your logic.
thank you so much for your time on this.