It is narrated from Sayyiduna Anas (may Allah be pleased with him) that he said: "I served the Messenger of Allah (peace and blessings be upon him) for ten years, and he (peace and blessings be upon him) never sent me for any need that could not be fulfilled but he (peace and blessings be upon him) would say: 'If it had been decreed, it would have happened,' or he said: 'If it had been destined, it would have happened.'"
As for the mention of the hadith, it is in the Sahih.