Language:
كتاب النكاح
67  
Wedlock, Marriage (Nikaah)
(120)
Chapter: "I will go round all my wives tonight."
(119)
باب قَوْلِ الرَّجُلِ لأَطُوفَنَّ اللَّيْلَةَ عَلَى نِسَائِي
Sahih al-Bukhari 5242

Narrated Abu Huraira:

(The Prophet) Solomon son of (the Prophet) David said, "Tonight I will go round (i.e. have sexual relations with) one hundred women (my wives) everyone of whom will deliver a male child who will fight in Allah's Cause." On that an Angel said to him, "Say: 'If Allah will.' " But Solomon did not say it and forgot to say it. Then he had sexual relations with them but none of them delivered any child except one who delivered a half person. The Prophet (ﷺ) said, "If Solomon had said: 'If Allah will,' Allah would have fulfilled his (above) desire and that saying would have made him more hopeful."

حَدَّثَنِي مَحْمُودٌ، حَدَّثَنَا عَبْدُ الرَّزَّاقِ، أَخْبَرَنَا مَعْمَرٌ، عَنِ ابْنِ طَاوُسٍ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، قَالَ ‏"‏ قَالَ سُلَيْمَانُ بْنُ دَاوُدَ ـ عَلَيْهِمَا السَّلاَمُ ـ لأَطُوفَنَّ اللَّيْلَةَ بِمِائَةِ امْرَأَةٍ، تَلِدُ كُلُّ امْرَأَةٍ غُلاَمًا، يُقَاتِلُ فِي سَبِيلِ اللَّهِ، فَقَالَ لَهُ الْمَلَكُ قُلْ إِنْ شَاءَ اللَّهُ‏.‏ فَلَمْ يَقُلْ وَنَسِيَ، فَأَطَافَ بِهِنَّ، وَلَمْ تَلِدْ مِنْهُنَّ إِلاَّ امْرَأَةٌ نِصْفَ إِنْسَانٍ ‏"‏‏.‏ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ لَوْ قَالَ إِنْ شَاءَ اللَّهُ لَمْ يَحْنَثْ، وَكَانَ أَرْجَى لِحَاجَتِهِ ‏"‏‏.‏
Reference : Sahih al-Bukhari 5242
In-book reference : Book 67, Hadith 175
USC-MSA web (English) reference : Vol. 7, Book 62, Hadith 169
  (deprecated numbering scheme)