Sahih Bukhari Volume 2, Book 23, Hadith Number 374.
Narated By Anas bin Malik : We were (in the funeral procession) of one of the daughters of the Prophet and he was sitting by the side of the grave. I saw his eyes shedding tears. He said, “Is there anyone among you who did not have sexual relations with his wife last night?” Abu Talha replied in the affirmative. And so the Prophet told him to get down in the grave. And so he got down in her grave.