Current result
-- Scenario1--For ID 1 and 2, I want to compare if Diff Between (DD,Begin date of ID 2 , End Date OF ID 1) < = 1, then the value should be true and be displayed other wise don't display the value
Scenario2 For ID 10 and 11 -- Begin Date for ID 10 and Begin Date of ID 11 is same, so I want to compare based on Paid date, As Paid Date of ID 11 is > Paid date of ID 10. I want the value to be displayed which is greater
Id Employeekey ReceiptNo BeginDate endDate PaidDate main Supplier RollNo
1 101 5505 3/28/2016 3/29/2016 4/29/2016 1 2001 655
2 101 5506 3/30/2016 4/1/2016 4/30/2016 1 2001 666
3 101 5507 4/5/2016 4/6/2016 4/30/2016 1 2001 155
4 101 5508 4/7/2016 4/10/2016 5/1/2016 1 2001 155
5 101 5509 4/11/2016 4/14/2016 5/5/2016 1 2001 155
6 101 5510 5/1/2016 5/3/2016 6/24/2016 1 2001 255
7 101 5511 5/1/2016 5/3/2016 6/30/2016 1 2001 265
8 102 5512 3/28/2017 3/29/2016 4/29/2017 1 2001 655
9 102 5513 3/28/2017 3/29/2016 4/29/2017 1 2001 655
10 102 5514 3/28/2017 3/29/2016 4/29/2017 1 2001 655
11 102 5515 3/28/2016 3/29/2016 5/29/2016 1 2001 655
12 102 5515 3/28/2016 3/29/2016 5/29/2016 1 2001 659