Můžete použít VNĚJŠÍ POUŽITÍ . Je to jako korelovaný poddotaz, ale umožňuje více sloupců:
SELECT p.ID,
p.Patient,
p.ProcedureType,
p.ProcedureDate,
[LastExamDate] = exam.ProcedureDate,
[DaysSinceLastExam] = DATEDIFF(DAY, exam.ProcedureDate, p.ProcedureDate),
[LastExamType] = exam.ProcedureType
FROM Procedures p
OUTER APPLY
( SELECT TOP 1 exams.ProcedureType, exams.ProcedureDate
FROM Procedures exams
WHERE Exams.ProcedureType LIKE '%Exam%'
AND Exams.Patient = p.Patient
AND Exams.ProcedureDate <= p.ProcedureDate
ORDER BY Exams.ProcedureDate DESC
) exam;