sreedhar writes:

> CREATE TABLE XX(..,fldDate DATETIME DEFAULT NOW() NOT NULL, ..);
> 
> NOW() & CURDATE() both will give Current date. But I am getting syntax
> error.
> 
> If i give some Date like 10/31/2001 it is taking as default.

You didn't bother to search the manual, did you? In the
chapter on CREATE TABLE, it says this:
"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 CURRENT_DATE"

Consider using a TIMESTAMP, or insert NOW() whenever you
insert.

//C

-- 
 Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280
 [EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/
 Amiga user since '89, and damned proud of it too.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to