I am not sure how you would wanna use it but here are two different scenario to use the days difference.
The first one gets you the
Days difference between consecutive records with same IntsId
select ISNULL(DATEDIFF(dd,M1.Date, (Select [Date] from MyTable where dateId = M1.dateId + 1 and InstId = M1.InstId)), 0) as diff from MyTable M1
The second one checks if there are any consecutive records with same InstId with difference greater than 30.
select 'Charge 10%' as Fine from MyTable M1
where ISNULL(DATEDIFF(dd,M1.Date, (Select [Date] from MyTable where dateId = M1.dateId + 1 and InstId = M1.InstId)), 0) > 30
Hope it helps.
Good luck