The Messenger of Allah ﷺ made a brotherhood between two men, one of whom was killed (in Allah's path), and a week or thereabouts later the other died, and we prayed at his funeral). The Messenger of Allah ﷺ asked: What did you say? We replied: We prayed for him and said: O Allah, forgive him, and join him to his companion. The Messenger of Allah ﷺ said: What about his prayers since the time the other died, and his fasting since the time the other died--the narrator Shu'bah doubted the words, "his fasting--and his deeds since the time the other died. The distance between them is just like the distance between heaven and earth.
آخَى رَسُولُ اللَّهِ ﷺ بَيْنَ رَجُلَيْنِ فَقُتِلَ أَحَدُهُمَا وَمَاتَ الآخَرُ بَعْدَهُ بِجُمُعَةٍ أَوْ نَحْوِهَا فَصَلَّيْنَا عَلَيْهِ فَقَالَ رَسُولُ اللَّهِ ﷺ مَا قُلْتُمْ فَقُلْنَا دَعَوْنَا لَهُ وَقُلْنَا اللَّهُمَّ اغْفِرْ لَهُ وَأَلْحِقْهُ بِصَاحِبِهِ فَقَالَ رَسُولُ اللَّهِ ﷺ فَأَيْنَ صَلاَتُهُ بَعْدَ صَلاَتِهِ وَصَوْمُهُ بَعْدَ صَوْمِهِ شَكَّ شُعْبَةُ فِي صَوْمِهِ وَعَمَلُهُ بَعْدَ عَمَلِهِ إِنَّ بَيْنَهُمَا كَمَا بَيْنَ السَّمَاءِ وَالأَرْضِ