BT 307 then EW 8231 at Helsinki
Riga → Helsinki → Berlin
Timetable, Helsinki time
20:55BT 307 from Riga at the gate
20:45EW 8231 to Berlin leaves the gate
23 h 50 apart on the timetable, overnight
EW 8231 leaves 23 h 50 after BT 307 arrives on the timetable: more than half a day, so not a connection we count.