0

I need to insert an empty value into a date field.

I've read how to insert an empty value in mysql date type field? which states to set the field to allow null. I've done that.

It also states to isnert null rather than an empty value. Unfortunatly that's not possible with the current set up - is there a way to allow it to input an empty string?

Community
  • 1
  • 1
panthro
  • 22,779
  • 66
  • 183
  • 324
  • "Not possible with the current setup" , why? what is your current setup? . No, it's not possible to insert a string into a date column, either insert `NULL` , or change it to a string column(which is not recommended at all!) – sagi Nov 29 '16 at 14:34

1 Answers1

-1

Say, your table is:

CREATE TABLE MyTable (A INT ,
                      B INT ,
                      C INT
                     ) ;

The statement:

INSERT INTO MyTable (B,C) VALUES (3,4) ;

will leave A null.

FDavidov
  • 3,505
  • 6
  • 23
  • 59