Sayyiduna Abu Kabshah al-Anmari (may Allah be pleased with him) said that he heard the Messenger of Allah (peace and blessings be upon him) saying: "I am going to narrate a hadith to you, so remember it: The people of this world are of four kinds: A servant whom Allah has given both wealth and knowledge in this world, so he fears his Lord in it, maintains the ties of kinship, and acts in it according to Allah's right; this person is at the very best rank. And a servant whom Allah has given knowledge but not wealth, so he is sincere in his intention and says: 'If I had wealth, I would do as so-and-so does,' so the reward of the two of them is equal. And a servant whom Allah has given wealth but not knowledge, so he keeps floundering in his wealth without knowledge; he neither fears his Lord in it, nor maintains the ties of kinship, nor fulfils Allah's right; this person is at the very worst rank. And a servant whom Allah has given neither wealth nor knowledge, and he says: 'If I had wealth, I would do as so-and-so does,' so that is his intention, and the sin of the two of them is equal."
Hadith Referenceالمعجم الكبير للطبراني / مسند من يعرف بالكنى / 19071