The Messenger of Allah ﷺ said, "Many a person who fasts gains nothing from his fasting but hunger and thirst, and many a person who stands in prayer at night gains nothing from his standing but sleeplessness."
حدثنا سليمان حدثنا إسماعيل أخبرني عمرو يعني ابن أبي عمرو عن أبي سعيد المقبري
قال رسول الله ﷺ رب صائم حظه من صيامه الجوع والعطش ورب قائم حظه من قيامه السهر
Its chain of transmission is hasan. It includes Amr bin Abu Amr, about whom some scholars raised criticism. The wording of the hadith is found in Bayhaqi 4/270, and Shihab Qudai 1426, and Hakim graded it sahih in 1/431, and Dhahabi agreed with him. A similar version was narrated by Ibn Majah 1/539, no. 1690, in the chapter on Fasting, on what has been said about backbiting and obscene speech for one who is fasting, and by Tabarani in Al-Kabir 12/382.