Hadith 212

نا بِهِ نا بِهِ سَعِيدُ بْنُ عَبْدِ الرَّحْمَنِ الْمَخْزُومِيُّ ، نا سُفْيَانُ بِهَذَا الإِسْنَادِ ، فَقَالَ : إِنَّ عُمَرَ بْنَ الْخَطَّابِ سَأَلَ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : أَيَنَامُ أَحَدُنَا وَهُوَ جُنُبٌ ؟ قَالَ : " إِذَا أَرَادَ أَنْ يَنَامَ ، فَلْيَتَوَضَّأْ "
It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that Sayyiduna Umar (may Allah be pleased with him) asked the Messenger of Allah (peace and blessings be upon him), "Can any one of us sleep in a state of janabah (major ritual impurity)?" The Prophet (peace and blessings be upon him) said: "When he intends to sleep, he should perform ablution."
Hadith Reference صحيح ابن خزيمه / جماع أبواب فضول التطهير والاستحباب من غير إيجاب / 212
Hadith Takhrij صحيح مسلم