FR 9840 then FR 790 at Lisbon
Cologne → Lisbon → Bologna
Timetable, Lisbon time
23:30FR 9840 from Cologne at the gate
15:40FR 790 to Bologna leaves the gate
16 h 10 apart on the timetable, overnight
FR 790 leaves 16 h 10 after FR 9840 arrives on the timetable: more than half a day, so not a connection we count.