Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:5472Abū Bakr Aḥmad b. al-Ḥasan al-Qāḍī And ʾAbū Zakariyyā b. Abū Isḥāq al-Muzakkī Waʾabū ʿAbd al-Raḥman al-Sulamī > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > Baḥr b. Naṣr > Quriʾ > Ibn Wahb Akhbarak Yaḥyá b. Ayyūb > Ḥumayd al-Ṭawīl > a man > ʿAbdullāh b. ʿUmar

[Machine] The Messenger of Allah ﷺ prayed seventeen rak'ahs while at Ta'if. The scholar said it is possible to combine the narration of the one who narrated nineteen rak'ahs with the narration of the one who narrated seventeen rak'ahs, and the narration of the one who narrated eighteen rak'ahs. Whoever narrates nineteen rak'ahs should count them as part of the day of arrival and the day of departure, and whoever narrates eighteen rak'ahs, no one should count them as part of both days. And Allah knows best.  

البيهقي:٥٤٧٢وَأَخْبَرَنَا أَبُو بَكْرٍ أَحْمَدُ بْنُ الْحَسَنِ الْقَاضِي وَأَبُو زَكَرِيَّا بْنُ أَبِي إِسْحَاقَ الْمُزَكِّي وَأَبُو عَبْدِ الرَّحْمَنِ السُّلَمِيُّ قَالُوا ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ ثنا بَحْرُ بْنُ نَصْرٍ قَالَ قُرِئَ عَلَى ابْنِ وَهْبٍ أَخْبَرَكَ يَحْيَى بْنُ أَيُّوبَ عَنْ حُمَيْدٍ الطَّوِيلِ عَنْ رَجُلٍ عَنْ عَبْدِ اللهِ بْنِ عُمَرَ

أَنَّ رَسُولَ اللهِ ﷺ أَقَامَ سَبْعَ عَشْرَةَ يُصَلِّي رَكْعَتَيْنِ مُحَاصِرًا الطَّائِفَ قَالَ الشَّيْخُ وَيُمْكِنُ الْجَمْعُ بَيْنَ رِوَايَةِ مَنْ رَوَى تِسْعَ عَشْرَةَ وَرِوَايَةِ مَنْ رَوَى سَبْعَ عَشْرَةَ وَرِوَايَةِ مَنْ رَوَى ثَمَانِ عَشْرَةَ بِأَنَّ مَنْ رَوَاهَا تِسْعَ عَشْرَةَ عَدَّ يَوْمَ الدُّخُولِ وَيَوْمَ الْخُرُوجِ وَمَنْ رَوَى ثَمَانِ عَشْرَةَ لَمْ يَعُدَّ أَحَدَ الْيَوْمَيْنِ وَمَنْ قَالَ سَبْعَ عَشْرَةَ لَمْ يَعُدَّهُمَا وَاللهُ أَعْلَمُ