Hi @Nida_mallik, what you need to do on wards 4th step is you need to find the duplicate invoice no in DtAllDataTable.
For this, apply for each row , on distinceDtDatable and get you will get the first record from distinceDtDatable i.e.
1A invoice no and 30-03-2020 date from 1A and 2A.
Now compare 1A with DtAllDataTable first record i.e 1A so here invoice no and date has been matched and count will be 1
For next iteration again you will get 1A with 30-03-2020 data in DtAllDataTable and here date will not match from distinceDtDatable, so you need to update incorrect in Remarks.
I hope this clarify.
If you need code, lease let me know.