UX 1042 then IB 797 at Madrid
Rome → Madrid → Vienna
Timetable, Madrid time
20:35UX 1042 from Rome at the gate
19:55IB 797 to Vienna leaves the gate
23 h 20 apart on the timetable, overnight
IB 797 leaves 23 h 20 after UX 1042 arrives on the timetable: more than half a day, so not a connection we count.