The Prophet ﷺ said, "None of you should say, 'I fasted the entirety of Ramadan,' or 'I prayed through all of its nights.'"I am not certain whether he disliked self-praise, or whether he said that there must inevitably be some lapse and some sleep.The wording is that of Ubaydullah.
أخبرنا إسحق بن إبراهيم قال أنبأنا يحيى بن سعيد قال أنبأنا المهلب بن أبي حبيبة ح وأنبأنا عبيد الله بن سعيد قال حدثنا يحيى عن المهلب بن أبي حبيبة قال أخبرني الحسن
عن النبي ﷺ قال لا يقولن أحدكم صمت رمضان ولا قمته كله ولا أدري كره التزكية أو قال لا بد من غفلة ورقدة اللفظ لعبيد الله
Its chain of transmission is daif. Abu Dawud narrated it in the chapter on Fasting, in the section on one who says "I fasted the whole of Ramadan," hadith no. 2415, from the hadith of Yahya bin Saeed Qattan, with this chain. It is also found in al-Kubra, hadith no. 2419, and Ibn Hibban graded it sahih, hadith no. 915, as did Ibn Khuzayma, hadith no. 2075.Hasan Basri narrated it using "an" (indicating a possible break in the chain).