IB 817 then DY 2063 at Copenhagen
Madrid → Copenhagen → Riga
Timetable, Copenhagen time
14:45IB 817 from Madrid at the gate
11:55DY 2063 to Riga leaves the gate
21 h 10 apart on the timetable, overnight
DY 2063 leaves 21 h 10 after IB 817 arrives on the timetable: more than half a day, so not a connection we count.