When did Charles Grey, 2nd Earl Grey, end his position as the Secretary of State for Foreign and Commonwealth Affairs?
SELECT ?value WHERE { wd:Q294662 p:P39 ?s . ?s ps:P39 wd:Q1371091 . ?s pq:P582 ?value}
charles grey, 2nd earl grey: Q294662 secretary of state for foreign and commonwealth affairs: Q1371091