tag:blogger.com,1999:blog-9075786158122089104.post6995556896146590796..comments2023-10-23T19:47:51.926+05:30Comments on SQL-Server Blog of Ritesh Shah --Fight the fear of SQL with SQLHub.com: DateTime observation in SQL Server 2008, Rounding or Bug?Ritesh Shahhttp://www.blogger.com/profile/09562656548324468450noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-9075786158122089104.post-9461964016027198902009-07-29T17:48:56.522+05:302009-07-29T17:48:56.522+05:30Yes,
DATETIME has precision of only 3 milisecond...Yes, <br /><br />DATETIME has precision of only 3 milisecond.Pinal Davehttp://blog.sqlauthority.comnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-51977279350374187552009-07-29T17:45:16.453+05:302009-07-29T17:45:16.453+05:30Hi Pinal,
Thank you very much for your response. ...Hi Pinal,<br /><br />Thank you very much for your response. I really appreciate it. BTW, does it mean that DateTime data type is not accurate up to milliseconds?Ritesh Shahhttps://www.blogger.com/profile/09562656548324468450noreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-87838060317558577902009-07-29T17:44:15.785+05:302009-07-29T17:44:15.785+05:30One more thing,
SQL Server DATETIMEhas precision ...One more thing,<br /><br />SQL Server DATETIMEhas precision of 3 millisecond. <br /><br />Just like SMALLDATETIME has precision of 1 min.<br /><br />Kind Regards,<br />PinalPinal Davehttp://blog.sqlauthority.comnoreply@blogger.comtag:blogger.com,1999:blog-9075786158122089104.post-67236977519703069952009-07-29T17:41:43.988+05:302009-07-29T17:41:43.988+05:30Hi Ritesh,
This is expected behavior of SQL Serve...Hi Ritesh,<br /><br />This is expected behavior of SQL Server DATETIME datatype. Same kind of accuracy is available in SQL Server 2000 and SQL Server 2005.<br /><br />SQL Server 2008 Datatype DATETIME2 which is much larger accuracy.<br /><br />Run above example again as following change.<br /><br /><br />DECLARE @datetest DATETIME2<br />SET @datetest = '2009-01-01 23:59:59.998'<br />SELECT @datetest --answer is 2009-01-01 23:59:59.9980000<br />GO<br /><br />Kind Regards,<br />PinalPinal Davehttp://blog.sqlauthority.comnoreply@blogger.com