Mike Morton <[EMAIL PROTECTED]> wrote: > I am trying to change a column specification, a date column, so that the > default value is the current date. Is this possible? I just get an error > on the change query: > > alter table Hits modify modify Date date NOT NULL default CURDATE(); > > ERROR 1064: You have an error in your SQL syntax. Check the manual that > corresponds to your MySQL server version for the right syntax to use near > 'date NOT NULL default CURDATE()' at line 1 > > Am I just stupid trying to have a function for a default? And if so, is it > possible to get the 'current date' as the default value for a field? >
Default value cannot be a function. In your case TIMESTAMP column may help you: http://www.mysql.com/doc/en/DATETIME.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]