not sure if I understand it correctly ... what is date? Is it today? or is it some arbitrary date? And what do you mean by each day 20 days prior to today? Is is each date_submitted within 20 days of today?
Assuming it's some arbitrary date, you would do something like this ...
date_resolved >= '2009-09-09'
OR (date_resolved IS NULL AND date_submitted < '2009-09-09')
) AND date_submitted >= CURDATE() - INTERVAL 20 DAYS
I don't think the above makes sense though ... why would you want to have date_submitted > (today - 20 days) and date_submitted > some date ... Perhaps I'm not understanding your question right.
Here is what I think should work. The problem is once I add the interval clause the results only include items with dates matching the Submit_Date, does not count items with a tcgaz_data_dates.Submit_Date < '2009-09-09'.
In the end the '2009-09-09' should really be the same as the interval date -
CURDATE() - INTERVAL 20 DAY, but I am not sure how the query will behave with two intervals in the same query.
(tcgaz_data_dates.date_resolved >= CURDATE() - INTERVAL 20 DAY
OR (tcgaz_data_dates.date_resolved IS NULL
AND tcgaz_data_dates.Submit_Date < '2009-09-09')
AND tcgaz_data_dates.Submit_Date >= CURDATE() - INTERVAL 20 DAY
AND tcgaz_data_dates.product_platform in ('0', 'HPP')
AND state not in ('1AAAA', 'Duplicate', 'Failed', 'Rejected', 'Unreproducible')