I want to pull the emails from 40 days ago and 20 days ago, each range being 1 day. This is what I have but it returns no rows.
SELECT s.*, r.email FROM sellyourcar s INNER JOIN register r ON s.rid = r.slno WHERE s.dt BETWEEN DATE_SUB(curdate(),INTERVAL 20 DAY) AND DATE_SUB(curdate(), INTERVAL 19 DAY) AND s.t BETWEEN DATE_SUB(curdate(),INTERVAL 40 DAY) AND DATE_SUB(curdate(), INTERVAL 39 DAY)