I have a DATETIME field in a table where I set up as ‘0’ on the insert.
The value ends up being equal to ‘0000-00-00 00:00:00’
When I use:
SELECT ...
WHERE DATE+INTERVAL 5 MONTH < NOW()
I don’t get these rows. Does that have anything to do with 1970?
The
datecolumn is probablynull, not0000-00-00. To verify this try:A comparison with
nullis neither true nor false, but “unknown”. Since thewhereclause demands that the condition is true (and not false or unknown) rows with anulldate are filtered out of the result set.