Unsupported Screen Size: The viewport size is too small for the theme to render properly.

How Do You Set The Default Vale For A Date Field?

forums forums SQLyog Using SQLyog How Do You Set The Default Vale For A Date Field?

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #11614
      WyleySam
      Member

      How do you set the default value for a date field in a table to the current date??? I entered curdate() in the Default column when creating the table, but it did now work. The datatype column is set to date.

    • #29419
      Manoj
      Member

      According to 10.1.4. Data Type Default Values no, you can't do that with date column.

      But you can do it with timestamp.

      create table test (

      id int,

      ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP);

Viewing 1 reply thread
  • You must be logged in to reply to this topic.