CA 865 then IB 1401 at Madrid
Beijing → Madrid → Valencia
Timetable, Madrid time
12:20CA 865 from Beijing at the gate
11:30IB 1401 to Valencia leaves the gate
23 h 10 apart on the timetable, overnight
IB 1401 leaves 23 h 10 after CA 865 arrives on the timetable: more than half a day, so not a connection we count.