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