Results 1 to 3 of 3

Thread: SQL dates

  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    New Jersey, USA
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL dates

    I am new to SQL and was wondering if anyone can help me with a date question. Through my reading I see that dates are stored with the date and time. I have decided to use small datetime for a field that will capture the current system date as a default when a new record is appended. Is there anyway I can just save the date and not the time. I can't seem to come up with a clear answer in my reading.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: SQL dates

    In Microsoft SQL Server? I think in MS Access a date without a time actually is stored as a date with a time of 12:00:00 AM. Not sure whether SQL Server works the same way.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL dates

    I believe all variants of the Date field also store the time (although I can't remember for sure at the moment). You can get the desired result by using formatting when displaying. As Jefferson mentioned, the default time will be 12:00:00 (unless otherwise specified).

Posting Permissions

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