I have the following query
SELECT *
FROM attend
RIGHT OUTER JOIN noattend ON attend.date = noattend.date2
WHERE attend.date
BETWEEN \'2010-02-01\'
AND \'201
If you say that noattend is a table with a row for each date, you should use it in WHERE clause:
WHERE noattend.date2 BETWEEN (.....
And I think it's more clear to use LEFT JOIN :
SELECT *
FROM noattend
LEFT OUTER JOIN attend ON (attend.date = noattend.date2 AND attend.customerid =1)
WHERE noattend.date2
BETWEEN '2010-02-01'
AND '2010-04-01'
ORDER BY date DESC
LIMIT 0 , 30