Tariq bin Shihab reported,

A man became ritually impure and did not pray. He came to the Prophet ﷺ and told him about it. The Prophet ﷺ said, "You did the right thing."Another man became ritually impure, performed tayammum, and prayed. He came to the Prophet ﷺ, who said to him something similar to what he had said to the other, meaning, "You did the right thing."

Azami 1722

Sahih

عن طارق بن شهاب

أن رجلا أجنب فلم يصل، فأتى النبي ﷺ فذكر ذلك له فقال: أصبت. فأجنب رجل آخر فتيمم وصلى، فأتاه فقال نحو ما قال للآخر، يعني أصبت.

الأعظمي 1722صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tayammum
Section
Two men in a state of major impurity, one of them performed tayammum and prayed while the other did not pray
Numbering
Jami al-Kamil 1722 (2nd edition)