MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Egor Egorov Date:September 18 2002 1:31pm
Subject:re: date field - default value = current date
View as plain text  
neal,
Wednesday, September 18, 2002, 11:32:39 AM, you wrote:

n> Is there a wat to have mySQL auto fill in the current date into my
n> dateCreated field?

n> In SQLServer I would simply specify the getDate() method as a default value.
n> I presume I would use the analogous MySQL function curDate() but it does not
n> appear to work for me.

You can't use function as a default value. May be TIMESTAMP column
type is what you want, look at:
     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
 / /|_/ / // /\ \/ /_/ / /__   Egor.Egorov@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



Thread
Connect to Database over the InternetBryan18 Sep
  • determine value of auto-increment field after adding record - @ runtimeneal18 Sep
    • date field - default value = current dateneal18 Sep
      • Re: date field - default value = current dateMikhail Entaltsev18 Sep
      • re: date field - default value = current dateEgor Egorov18 Sep
      • Re: date field - default value = current datePaul DuBois19 Sep
    • Re: determine value of auto-increment field after adding record - @ runtimepeter.brawley18 Sep
    • re: determine value of auto-increment field after adding record - @ runtimeEgor Egorov18 Sep
  • RE: Connect to Database over the InternetJindo18 Sep
    • RE: Connect to Database over the InternetBryan19 Sep
  • RE: Connect to Database over the InternetMike Hillyer18 Sep