kakki wrote:maybe this
SELECT ...
FROM ...
WHERE myDate>=DATE_SUB(NOW(),INTERVAL 6 MONTH)
A step in the right direction, but he wants whole months... I'd use date_trunc in pgsql to do it.
select
from
where datefield between
date_trunc('month',now()-interval '7 months')::timestamp and
date_trunc('month',now())::timestamp - interval '1 second';
Of course, mysql will have different built in functions...