AY 414 then BT 306 at Helsinki
Kajaani → Helsinki → Riga
Timetable, Helsinki time
16:00AY 414 from Kajaani at the gate
15:20BT 306 to Riga leaves the gate
23 h 20 apart on the timetable, overnight
BT 306 leaves 23 h 20 after AY 414 arrives on the timetable: more than half a day, so not a connection we count.