FR 3813 then IB 7849 at Madrid
Bologna → Madrid → Riga
Timetable, Madrid time
21:35FR 3813 from Bologna at the gate
17:15IB 7849 to Riga leaves the gate
19 h 40 apart on the timetable, overnight
IB 7849 leaves 19 h 40 after FR 3813 arrives on the timetable: more than half a day, so not a connection we count.