user24170: The fourth precept says we should be truthful. I think this means it's virtuous to truthfully admit to uncertainty when you don't know an answer, instead of pretending you do know or evading the question. Did the Buddha ever admit to not knowing something?

user14793: To not knowing something? Buddha? A "handful of leaves" appear to say Buddha only revealed a handful of leaves of an entire forest of leaves he knew of. And that handful, only related to how suffering/discontent originated, and how it could be halted, primarily. I imagine the 45 years of his dispensation was too short and too precious, to be spent on anything else? Regards

user254: There are famously some topics that are "undeclared" i.e. questions to which the Buddha did not declare an answer.
They're "SN 44" (i.e. SN 44.1 through SN 44.11) and listed translated e.g. here or here.
There's an introduction here -- Introduction to the Avyakata Samyutta (Undeclared-connected) by Thanissaro Bhikkhu -- which categorizes the questions and reasons why they're unanswered.
They're summarised i.e. just briefly listed on Wikipedia -- The unanswered questions.

Ironically this doesn't answer your question -- i.e. "Did the Buddha ever say, 'I don't know'?" -- but I hope this reference (to what he did say) is closely-related enough, to be on-topic and of interest to you.

user471: In the sutta quote below, the Buddha clearly states that he is not all-knowing.
There are some things that he knows and others that he may not know (yet).

Vaccha: “Sir, I have heard this: ‘The ascetic Gotama claims to be all-knowing
and all-seeing, to know and see everything without exception, thus:
“Knowledge and vision are constantly and continually present to me,
while walking, standing, sleeping, and waking.”’ I trust that those
who say this repeat what the Buddha has said, and do not misrepresent
him with an untruth? Is their explanation in line with the teaching?
Are there any legitimate grounds for rebuke and criticism?”
Buddha: “Vaccha, those who say this do not repeat what I have said. They
misrepresent me with what is false and untrue.”
Vaccha: “So how should we answer so as to repeat what the Buddha has said, and
not misrepresent him with an untruth? How should we explain in line
with his teaching, with no legitimate grounds for rebuke and
criticism?”
Buddha: “‘The ascetic Gotama has the three knowledges.’ Answering like this
you would repeat what I have said, and not misrepresent me with an
untruth. You would explain in line with my teaching, and there would
be no legitimate grounds for rebuke and criticism.
MN 71

Also, please see this answer.

24170: <p>The fourth precept says we should be truthful. I think this means it's virtuous to truthfully admit to uncertainty when you don't know an answer, instead of pretending you do know or evading the question. Did the Buddha ever admit to not knowing something?</p>
 14793: <p>To not knowing something? Buddha? A &quot;handful of leaves&quot; appear to say Buddha only revealed a handful of leaves of an entire forest of leaves he knew of. And that handful, only related to how suffering/discontent originated, and how it could be halted, primarily. I imagine the 45 years of his dispensation was too short and too precious, to be spent on anything else? Regards</p>
 254: <p>There are famously some topics that are &quot;undeclared&quot; i.e. questions to which the Buddha did not declare an answer.</p>
<p>They're &quot;SN 44&quot; (i.e. SN 44.1 through SN 44.11) and listed translated e.g. <a href="https://www.accesstoinsight.org/tipitaka/sn/index.html#sn44" rel="nofollow noreferrer">here</a> or <a href="https://suttacentral.net/sn44?view=normal" rel="nofollow noreferrer">here</a>.</p>
<p>There's an introduction here -- <a href="https://www.accesstoinsight.org/tipitaka/sn/sn44/sn44.intro.than.html" rel="nofollow noreferrer">Introduction to the Avyakata Samyutta (Undeclared-connected) by Thanissaro Bhikkhu</a> -- which categorizes the questions and reasons why they're unanswered.</p>
<p>They're summarised i.e. just briefly listed on Wikipedia -- <a href="https://en.wikipedia.org/wiki/The_unanswered_questions" rel="nofollow noreferrer">The unanswered questions</a>.</p>
<hr />
<p>Ironically this doesn't answer your question -- i.e. &quot;Did the Buddha ever say, 'I don't know'?&quot; -- but I hope this reference (to what he did say) is closely-related enough, to be on-topic and of interest to you.</p>
 471: <p>In the sutta quote below, the Buddha clearly states that he is not all-knowing.</p>
<p>There are some things that he knows and others that he may not know (yet).</p>
<blockquote>
<p>Vaccha: “Sir, I have heard this: ‘The ascetic Gotama claims to be all-knowing
and all-seeing, to know and see everything without exception, thus:
“Knowledge and vision are constantly and continually present to me,
while walking, standing, sleeping, and waking.”’ I trust that those
who say this repeat what the Buddha has said, and do not misrepresent
him with an untruth? Is their explanation in line with the teaching?
Are there any legitimate grounds for rebuke and criticism?”</p>
<p>Buddha: “Vaccha, those who say this do not repeat what I have said. They
misrepresent me with what is false and untrue.”</p>
<p>Vaccha: “So how should we answer so as to repeat what the Buddha has said, and
not misrepresent him with an untruth? How should we explain in line
with his teaching, with no legitimate grounds for rebuke and
criticism?”</p>
<p>Buddha: “‘The ascetic Gotama has the three knowledges.’ Answering like this
you would repeat what I have said, and not misrepresent me with an
untruth. You would explain in line with my teaching, and there would
be no legitimate grounds for rebuke and criticism.<br />
<a href="https://suttacentral.net/mn71/en/sujato" rel="nofollow noreferrer">MN 71</a></p>
</blockquote>
<p>Also, please see <a href="https://buddhism.stackexchange.com/a/43390/471">this answer</a>.</p>
