Hi all,
I am a newbie at SQL and happily found HEIDI here.
Anyway I have begun a database and added a column DATETIME which, when I save gives a 1067 error. Any idea why?
Thanks for your time.
DATETIME 1067 error
Which zero I mean? The one stated in the error message:
Invalid default value for 'reg_date'
You've enclosed a screenshot where you attempt to create a table with a column called "reg_date" of type "DATETIME", which cannot be empty and with a default value of zero. Unlike other error messages, this one is rather direct.
I suspect you're thinking of relational databases like some kind of Excel-like spreadsheet, where you can type arbitrary values in any cell. Thankfully, that's not how relational databases work. Wherever you want something empty you have to use NULL, not zero or any other value.
Invalid default value for 'reg_date'
You've enclosed a screenshot where you attempt to create a table with a column called "reg_date" of type "DATETIME", which cannot be empty and with a default value of zero. Unlike other error messages, this one is rather direct.
I suspect you're thinking of relational databases like some kind of Excel-like spreadsheet, where you can type arbitrary values in any cell. Thankfully, that's not how relational databases work. Wherever you want something empty you have to use NULL, not zero or any other value.
Please login to leave a reply, or register at first.