From: Mikael Fridh [mailto:[EMAIL PROTECTED]
> or read about the TIMESTAMP type, but I guess that's too much
> precision since you only wanted the date, not the time.
> http://www.mysql.com/doc/en/DATETIME.html
It's only too much precision when you're selecting the whole field. You can simply
Mikael:
Thanks - I must have missed that in the create table docs - I did look there
first - honest!
And you are correct - in that the timestamp is too much precision, and
unfortunately due to the thousands of distributed apps that access this DB,
I cannot modify all the queries - oh well, gues
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
http://www.mysql.com/doc/en/CREATE_TABLE.html
"A DEFAULT value has to be a constant, it cannot be a function or an
expression."
...
"Default values must be constants. This means, for example, that you cannot
set the default for a date column to be the value of a function such as NOW()
or CURREN
t; cc:
Subject: Limitations on data for
default...
11/13/2003 10:15
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 th