Total Registered Private Foundations: 2005, 2010, 2015, Latest Year (10/2020)
SELECT '2005' AS YEAR, COUNT(EIN) AS 'All Registered Private Foundations', sum(if( assets > 10000 and taxper >= '2003', assets, 0)) as Total_Assets, sum(if( income > 10000 and taxper >= '2003', income, 0)) as Gross_Receipts FROM bmf.bm0507c3 WHERE (OUTNCCS IS NULL OR OUTNCCS <> 'OUT') AND FNDNCD IN ('02','03','04') and subsecCd = '03' AND fips='12009' UNION SELECT '2010' AS YEAR, COUNT(EIN) AS 'All Registered Private Foundations', sum(if( assets > 10000 and taxper >= '2008', assets, 0)) as Total_Assets, sum(if( income > 10000 and taxper >= '2008', income, 0)) as Gross_Receipts FROM bmf.bm1007c3 WHERE (OUTNCCS IS NULL OR OUTNCCS <> 'OUT') AND FNDNCD IN ('02','03','04') and subsecCd = '03' AND fips='12009' UNION SELECT '2015' AS YEAR, COUNT(EIN) AS 'All Registered Private Foundations', sum(if( assets > 10000 and taxper >= '2013', assets, 0)) as Total_Assets, sum(if( income > 10000 and taxper >= '2013', income, 0)) as Gross_Receipts FROM bmf.bm1507c3 WHERE (OUTNCCS IS NULL OR OUTNCCS <> 'OUT') AND FNDNCD IN ('02','03','04') and subsecCd = '03' AND fips='12009' UNION SELECT '2020 (October)' AS YEAR, COUNT(EIN) AS 'All Registered Private Foundations', sum(if( assets > 10000 and taxper >= YEAR(CURDATE())-2, assets, 0)) as Total_Assets, sum(if( income > 10000 and taxper >= YEAR(CURDATE()) -2, income, 0)) as Gross_Receipts FROM bmf.bm2010c3 WHERE (OUTNCCS IS NULL OR OUTNCCS <> 'OUT') AND FNDNCD IN ('02','03','04') and subsecCd = '03' AND fips='12009'