Hadith 2204
Chapter 39: The Reward of one who prays Qiyam in Ramadan and fasts the month out of faith and hope for reward - كتاب الصيام
أَخْبَرَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ، قَالَ حَدَّثَنَا سُفْيَانُ، عَنِ الزُّهْرِيِّ، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " مَنْ صَامَ رَمَضَانَ إِيمَانًا وَاحْتِسَابًا غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ " .
It was narrated that Abu Hurairah said:
"The Messenger of Allah said: 'Whoever fasts Ramadan out of faith and in the hope of reward, he will be forgiven his previous sins."'
Reference : Sunan an-Nasa'i 2204
In-book reference : Book 22, Hadith 115