Forum Moderators: open
SELECT s.*, r.email FROM sellyourcar s
INNER JOIN register r ON s.rid = r.slno
WHERE s.datetime BETWEEN DATE_SUB(curdate(),INTERVAL 20 DAY) AND DATE_SUB(curdate(), INTERVAL 19 DAY)
AND s.datetime BETWEEN DATE_SUB(curdate(),INTERVAL 40 DAY) AND DATE_SUB(curdate(), INTERVAL 39 DAY)
It works with one date range, but not 2.
Well now i see why that's wrong, but I don't see how to do it right.
[edited by: LifeinAsia at 4:57 pm (utc) on Jan. 23, 2009]
This was a silly mistake on my part. I should have spotted the problem earlier.