(4) Prayer
كتاب الصلاة
(8b) Chapter: Mosques and places of Prayer - Section 2
(7) باب المساجد ومواضع الصلاة - الفصل الثاني
Mishkat al-Masabih 730 
He also reported God’s Messenger as saying, “If anyone comes to a mosque for a purpose, he will attain it.” Abu Dawud transmitted it.
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «مَنْ أَتَى الْمَسْجِدَ لِشَيْءٍ فَهُوَ حَظُّهُ» . رَوَاهُ أَبُو دَاوُد
 حَسَنٍ  (الألباني)حكم :
Reference : Mishkat al-Masabih 730
In-book reference : Book 4, Hadith 159