It is narrated from Sayyidah Maymunah bint Sa'd (may Allah be pleased with her) that she said: I heard the Messenger of Allah (peace and blessings be upon him) saying: "Whoever makes a firm resolve (intention) to fast during the night, let him fast; and whoever reaches the morning without having made the intention during the night, let him not fast."
This ruling is for the obligatory fast, not for the voluntary fast.
Hadith Referenceالمطالب العالية بزوائد المسانيد الثمانية / كتاب الصيام / 1012
Hadith Gradingمحدثین:إسناده ضعيف جدًا
Hadith Takhrij«حکم الحدیث المطالب العالیہ محققاً تنسیق د. سعد بن ناصر بن عبد العزيز الشَّثري- مکتبہ شاملہ :إسناده ضعيف جدًا. » «أخرجه سنن الترمذي برقم: 730، وأخرجه سنن النسائي برقم: 2342، وأخرجه موطأ مالك برقم: 637، وأخرجه صحيح ابن خزيمة برقم: 1935، 2091، 2141، وأخرجه إتحاف الخيرة المهرة بزوائد المسانيد العشرة برقم: 2181»