Here is a piece of code which calculates if the flag IsDateDiffLess14_Calculation should be set or not.
SELECT RowID,
CASE WHEN DATEDIFF(DAY, Date2, LEAD(Date1) OVER(PARTITION BY IDNo ORDER BY RowId)) < 14
THEN 1
ELSE 0
END IsDateDiffLess14_Calculation
FROM YourTable
ORDER BY RowID
I am not sure if it's required to have this flag as persistent column in the table. If it is you should modify the script and use it whenever a new row is added to the table to update the previous row only and not the whole table.
___________________________
Do Not Optimize for Exceptions!