Results 1 to 3 of 3

Thread: NOW() default.

  1. #1
    Join Date
    Jun 2002
    Posts
    63

    NOW() default.

    Hi,

    I have another problem (no not that kinda problem), I have a table with a datetime field in it. I want the default value to be the current time, i.e. NOW(). But I don;t seem to be able to set that as the default:

    date datetime NOT NULL default NOW(),

    have also tried:

    date datetime NOT NULL default 'NOW()',

    But neither of them work. What am I doing wrong?

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171

    Re: NOW() default.

    Originally posted by mythix
    Hi,

    I have another problem (no not that kinda problem), I have a table with a datetime field in it. I want the default value to be the current time, i.e. NOW(). But I don;t seem to be able to set that as the default:

    date datetime NOT NULL default NOW(),

    have also tried:

    date datetime NOT NULL default 'NOW()',

    But neither of them work. What am I doing wrong?
    You are in the wrong forum here. Ask this question in the forum specific to your DBMS (Access, SQL Server, whatever).

  3. #3
    Join Date
    Jun 2002
    Posts
    63
    oops, of course i am, sorry!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •