Alternatif olarak ekledim biraz uzun oldu galiba
https://resim.accesstr.net/do.php?img=11111
SELECT t2.KOD,
(select SUM(t2.SURE) from TABLO1 as t1 LEFT JOIN TABLO2 as t2 ON t2.TARIH< t1.TARIH and t2.KOD= t1.KOD ) AS önceki,
(select SUM(t2.SURE) from TABLO1 as t1 LEFT JOIN TABLO2 as t2 ON t2.TARIH> t1.TARIH and t2.KOD= t1.KOD) AS sonraki
FROM TABLO1 AS t1
LEFT JOIN TABLO2 AS t2 ON t2.KOD=t1.KOD
GROUP BY t2.KOD;