Topic: ALTER TABLE ADD COLUMN NOT ACCEPTING

Dear @joe

I was trying to update a table by adding 2 extra column using phpmyadmin.

but I am getting this error "#1067 invalid default value for 'trans_date'"

The table I am trying to ALTER IS bank_trans.

ALTER TABLE `bank_trans` ADD `cheque_no` VARCHAR(60) NULL AFTER `ref`;

This is the error I am getting   "#1067 invalid default value for 'trans_date'"

What how can one add an extra column in a table to retrieve and save?

I wanted to add a check no to the payment, under reference, because, when you make payment from the bank you need a check or transfer letter(Reference)

How do I modify that?

Thanks

Re: ALTER TABLE ADD COLUMN NOT ACCEPTING

If I change the field trans_date to null and remove the default As define format 0000-00-00, I can ALTER the table, but It wont allow me to redefine the format to 0000-00-00

Same error again #Invalid format will appear

Re: ALTER TABLE ADD COLUMN NOT ACCEPTING

Which version of MySQL are you using? Try to set the STRICT SQL setting off and to accept Date as 0.