Abu Hurairah reported,

Sulayman said, "Tonight I will go around to ninety women, and each one will bear a boy who will fight in the cause of Allah."His companion said to him, Sufyan explained that this meant the angel, "Say, 'If Allah wills.'" But he forgot. He went around to all of them, and not one of them bore a child except a single woman, who delivered half a boy.Abu Hurairah, narrating this, said, "Had he said, 'If Allah wills,' he would not have broken his oath, and it would have been a means of attaining what he sought."On another occasion he said, the Messenger of Allah ﷺ said, "Had he made the exception."

Azami 8464

Sahih

عن أبي هريرة قال

قال سليمان: لأطوفن الليلة على تسعين امرأة كل تلد غلاما يقاتل في سبيل الله فقال له صاحبه قال سفيان يعني الملك قل إن شاء الله فنسي فطاف بهن فلم تأت امرأة منهن بولد إلا واحدة بشق غلام فقال أبو هريرة يرويه قال: لو قال إن شاء الله لم يحنث وكان دركا له في حاجته وقال مرة قال رسول الله ﷺ لو استثنى.

الأعظمي 8464صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Stories of the prophets
Chapter
Reports of Sulayman عليه السلام
Section
Number of wives of Sulayman عليه السلام
Numbering
Jami al-Kamil 8464 (2nd edition)
Azami 8464