Reputation: 1133
I have a table
CREATE TEMPORARY TABLE test (stamp TIMESTAMP);
And try to run inserts on it
INSERT INTO test VALUES('2003-01-01')
Fails with Incorrect datetime value: '2003-01-01' for column 'stamp' at row 1
And this one works
INSERT INTO test VALUES('2004-01-01')
Why would that happen?
Upvotes: 0
Views: 86
Reputation: 167172
You should not use TIMESTAMP
:
CREATE TEMPORARY TABLE `test` (`stamp` DATETIME);
You need to give that in the right format:
INSERT INTO `test` VALUES ('2004-01-01 00:00:00')
Upvotes: 1