I require the red circled Loan count numbers for accounts which have the any Loan Dt same as Cl Dt as per the highlighted ones.
The output should be the Loan count values.
Please see the attached screen shot.
I am not clear on what the question is from the screenshot. Maybe you could make a second screenshot where you edit the image to show what the final output should look like.
Retrieving data ...