hi.
i need help writing a query for a script. i have a table which has a DATE field which contains the date when that row was inserted.i need to select all the rows from that table that are more than 32 months old.how do i do that?
thx
... WHERE date > DATE_ADD(NOW(),INTERVAL 32 MONTH)
Note that you could also use the addition operator instead of the DATE_ADD() function:
NOW() + INTERVAL 32 MONTH
I use + (or -) in my code but DATE_ADD (or DATE_SU😎 in examples to others as its clearer and you can look up the function by name, hard to search for what + or - does.