It was narrated from Hafsah that the Prophet said:"Whoever does not have the intention of fasting from the night before, then there is no fast for him." (Daif)
أَخْبَرَنَا أَحْمَدُ بْنُ الأَزْهَرِ، قَالَ حَدَّثَنَا عَبْدُ الرَّزَّاقِ، عَنِ ابْنِ جُرَيْجٍ، عَنِ ابْنِ شِهَابٍ، عَنْ سَالِمٍ، عَنِ ابْنِ عُمَرَ، عَنْ حَفْصَةَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ " مَنْ لَمْ يُبَيِّتِ الصِّيَامَ مِنَ اللَّيْلِ فَلاَ صِيَامَ لَهُ " .
Nesai
The Book of Fasting • Hadith 2334