FR 9840 then EW 7603 at Lisbon
Cologne → Lisbon → Hamburg
Timetable, Lisbon time
23:30FR 9840 from Cologne at the gate
17:25EW 7603 to Hamburg leaves the gate
17 h 55 apart on the timetable, overnight
EW 7603 leaves 17 h 55 after FR 9840 arrives on the timetable: more than half a day, so not a connection we count.