عَنِ الْحَسَنِ مُرْسَلًا قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «مَنْ جَاءَهُ الْمَوْتُ وَهُوَ يَطْلُبُ الْعِلْمَ لِيُحْيِيَ بِهِ الْإِسْلَامَ فَبَيْنَهُ وَبَيْنَ النَّبِيِّينَ دَرَجَةٌ وَاحِدَةٌ فِي الْجَنَّةِ» . رَوَاهُ الدَّارمِيّ
Translation

He also reported in mursal form that God’s messenger was askedwhich of two men who had been among the B. Isra’il was superior, onewho was a learned man who observed the prescribed prayers, then satand taught men what is good, the other who fasted by day and prayedduring the night. He replied, “The superiority of this learned man whoobserved the prescribed prayers, then sat and taught men what is goodover the devout man who fasted by day and prayed during the night islike my superiority over the most contemptible among you.” Darimitransmitted it.