Sahih Muslim 4254
The Book of Oaths
وَحَدَّثَنِي أَبُو الطَّاهِرِ، أَحْمَدُ بْنُ عَمْرِو بْنِ سَرْحٍ حَدَّثَنَا ابْنُ وَهْبٍ، عَنْ يُونُسَ، ح وَحَدَّثَنِي حَرْمَلَةُ بْنُ يَحْيَى، أَخْبَرَنَا ابْنُ وَهْبٍ، أَخْبَرَنِي يُونُسُ، عَنِ ابْنِ شِهَابٍ، عَنْ سَالِمِ بْنِ، عَبْدِ اللَّهِ عَنْ أَبِيهِ، قَالَ سَمِعْتُ عُمَرَ بْنَ الْخَطَّابِ، يَقُولُ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِنَّ اللَّهَ عَزَّ وَجَلَّ يَنْهَاكُمْ أَنْ تَحْلِفُوا بِآبَائِكُمْ " . قَالَ عُمَرُ فَوَاللَّهِ مَا حَلَفْتُ بِهَا مُنْذُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم نَهَى عَنْهَا ذَاكِرًا وَلاَ آثِرًا .
Umar b. al-Khattib reported Allah's Messenger (ﷺ) as saying:Allah, the Great and Majestic, forbids you to swear by your fathers. Umar said: By Allah. I have never sworn (by my father) since I heard Allah's Messenger (ﷺ) forbidding it mentioning them" on my behalf" nor on behalf of someone else
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.