Hello,
I am not getting your requirement, but here I am sharing an example and pretty much sure this will help you out.
SELECT
DateID,
TotalDays,
CASE WHEN (TotalDays>=60) THEN 20 ELSE 10 END As Percentage
FROM
(
SELECT DateId , ISNULL(DATEDIFF(dd,D.Date, (select [Date] from [dbo].[Date] where DateId = D.DateId + 1 )),0) TotalDays
FROM [dbo].[Date] D
WHERE ISNULL(DATEDIFF(dd,D.Date, (select [Date] from [dbo].[Date] WHERE DateId = D.DateId + 1 )),0)>30
) As Tab1
You can customize it as per your requirement. If you still facing problem then please share complete details with table structure and example.