mysql between condition
Parenthesis will probably help:

col BETWEEN (now() - interval 30 day) AND now()


now() - interval 30 day means "30 days ago" - the whole expression is "between 30 days ago and now". Actually, unless you have values higher than current datetime, you can simply use:

col &gt;= NOW() - interval 30 day


This page is a good explanation of the INTERVAL syntax. MySQL documentation about time and date functions DATE_ADD() and DATE_SUB() explains the syntax as well: Date and time functions.

now() - interval 30 day is equivalent to date_sub(now(), interval 30 day), so you could also write the condition like this:

col BETWEEN date_sub(now(), interval 30 day) AND now()


Note that NOW() - interval 30 day means 30 days ago at this exact time, because NOW() returns a DATETIME value.