What I have is a query that updates a column called “active”. Right now my query is:
UPDATE MainTable
SET active = b'0'
WHERE lastprocessdate < '5/21/2011'
Unfortunately, this updates everything — which is impossible because everything has today’s date on it. lastprocessdate is a datetime column, that originally is processed using NOW().
Use this:
In MySQL dates are written
yyyy-mm-dd.