I'm in InterBase 7.5, But in most of my problems I just need to use SQL statements that are common to SQL Server without (I hope) having to change it a lot..
Don't worry about my last post, it's solved by this:
select T1.PatientID, T1.DateIni, min(T1.Dateend) , min(T1.Days)
from MyTable T1
where not exists(select * from MyTable T2
where T2.PatientID = T1.PatientID
and T2.Days between T1.Days+1 and 365)
group by 1, 2