MySQL: Find Missing Dates Between a Date Range
This is a second answer, I’ll post it separately. SELECT DATE(r1.reportdate) + INTERVAL 1 DAY AS missing_date FROM Reports r1 LEFT OUTER JOIN Reports r2 ON DATE(r1.reportdate) = DATE(r2.reportdate) – INTERVAL 1 DAY WHERE r1.reportdate BETWEEN ‘2011-01-01’ AND ‘2011-04-30’ AND r2.reportdate IS NULL; This is a self-join that reports a date such that no row … Read more