SQL Server datetime

  • SQL Server only has datetime. Can just the date without time be stored in the datetime ? Please let me know how to handle this.

    Thank you

  • In SQL 2008, there's a Date datatype that can do this. In 2005 and before, the usual thing to do is store a date with midnight as the time.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • How to do that? Thank you

  • How do you do what? Store a date with midnight as the time? That'll depend on how you're getting the data into the table. What does your application do?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply