Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Posts
    54

    Unanswered: Default Date Value (today)

    I have migrated from Access to SQL Server.
    In Access I have default date value of today's date.

    In SQL Server, it is empty (after migration).
    What is the corresponding syntax (value) to default to
    the current Date & Time in a DATETIME Field (using Design Table) ?

    Thanks you.

    Also, what is the difference between DATETIME and SMALLDATETIME
    fields ?

    Pierre.
    Pierre (Pl-Arts)

  2. #2
    Join Date
    Feb 2003
    Location
    Montreal, Canada
    Posts
    117

    Re: Default Date Value (today)

    1.The function that returns the current timestamp is GETDATE()
    2.datetime holds date and time from Jan 1,1753 to Dec 31,9999 with a three hundredth of a second accuracy
    smalldatetime holds date and time from Jan 1, 1900 to June 6,2079 with accuracy to the minute, that fits with most applications.



    Originally posted by Plarde
    I have migrated from Access to SQL Server.
    In Access I have default date value of today's date.

    In SQL Server, it is empty (after migration).
    What is the corresponding syntax (value) to default to
    the current Date & Time in a DATETIME Field (using Design Table) ?

    Thanks you.

    Also, what is the difference between DATETIME and SMALLDATETIME
    fields ?

    Pierre.
    Steve

  3. #3
    Join Date
    Dec 2002
    Location
    Antwerp, Belgium
    Posts
    227
    You can find this kind of info in the Books Online which is installed on your machine as you install sql server.
    Johan

  4. #4
    Join Date
    Jan 2003
    Location
    Dordrecht, The Netherlands
    Posts
    95

    Re: Default Date Value (today)

    An extra difference between datetime and smalldatetime types is for VB6 programmers. I've read somewhere that using smalldatetime gives problems in VB6 applications.

    Ad.

    Originally posted by dbadelphes
    1.The function that returns the current timestamp is GETDATE()
    2.datetime holds date and time from Jan 1,1753 to Dec 31,9999 with a three hundredth of a second accuracy
    smalldatetime holds date and time from Jan 1, 1900 to June 6,2079 with accuracy to the minute, that fits with most applications.

  5. #5
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    True its better to use DATETIME than the other with ADO/VB6.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

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