AA 8651 then QR 3683 at Barcelona
Madrid → Barcelona → Santander
Timetable, Barcelona time
19:15AA 8651 from Madrid at the gate
16:05QR 3683 to Santander leaves the gate
20 h 50 apart on the timetable, overnight
QR 3683 leaves 20 h 50 after AA 8651 arrives on the timetable: more than half a day, so not a connection we count.