סימן סא סעיף ו
הַמִּתְפַּלֵּל עַל מַה שֶּׁעָבַר, כְּגוֹן שֶׁשָּׁמַע קוֹל צְוָחָה בָּעִיר, וְאוֹמֵר: יְהִי רָצוֹן שֶׁלֹּא יְהֵא קוֹל זֶה בְּתוֹךְ בֵּיתִי. אוֹ שֶׁהָיְתָה אִשְׁתּוֹ מְעֻבֶּרֶת וּלְאַחַר אַרְבָּעִים יוֹם מֵעִבּוּרָהּ מִתְפַּלֵּל וְאוֹמֵר: יְהִי רָצוֹן שֶׁתֵּלֵד אִשְׁתִּי זָכָר, הֲרֵי זוֹ תְּפִלַּת שָׁוְא, כִּי מַה שֶּׁהָיָה הָיָה. אֲבָל בְּתוֹךְ אַרְבָּעִים יוֹם מוֹעִילָה תְּפִלָּה וְיָכוֹל לְהִתְפַּלֵּל. וּלְאַחַר אַרְבָּעִים יוֹם יָכוֹל לְהִתְפַּלֵּל, שֶׁיְהֵא הַוָּלָד זֶרַע שֶׁל קַיָמָא, טוֹב לַשָּׁמַיִם וְטוֹב לַבְּרִיּוֹת.
Praying for something that has already happened is a vain, useless prayer. The following are examples: if a person hears wailing in the town and says: "May it be Your will that this cry should not be in my house;" or if his wife has become pregnant and forty days after her conception, he would say the following prayer: "May it be Your will that my wife should give birth to a boy." Such prayers are useless for what has already happened belongs to the past. However, within the forty days, this prayer is worthwhile and may be offered. After forty days he may pray that the child should be a healthy baby, good in the sight of Heaven and of benefit to mankind.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)