I know this may come across as a newbie question, but I’m curious as to why dates in SQL need to look like this:
FieldBeginDate
2010-04-01 00:00:00.000
FieldEndDate
2010-12-31 23:59:00.000
Why the three-decimals or precision? And Is there a way to have dates shown as Month-Day-Year only? thanks!
SQL Server 2008 has a
DATEtype, which dismisses the time.Using the
DATEtype, rather than theDATETIMEtype also takes only a singleintto store the value… as opposed to the twoints needed to store aDATETIMEEDIT: You also ask why there are three decimal places… This is because of the precision with which the value is stored by default (@AaronBetrand aptly points out in the comments below that you can obtain extended precision). SQL Server stores times in one-three-hundredths-of-a-second increments.
Here is SQLDenis on the topic:
http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/how-are-dates-stored-in-sql-server