Issue with datetime

  • Hi All,

    In a table, I'm updating datetime values as below :

    create table testdate (id smallint, fieldx datetime)

    insert into testdate values (1,'2015-09-03 16:11:44.326')

    insert into testdate values (2,'2015-09-03 16:11:44.327')

    But I'm receiving the output of script select * from testdate as

    12015-09-03 16:11:44.327

    22015-09-03 16:11:44.327

    Why my output is different from my inputs !!! Am I missing something here?

    Regards.

  • https://msdn.microsoft.com/en-gb/library/ms187819.aspx

    Rounding of datetime Fractional Second Precision

    datetime values are rounded to increments of .000, .003, or .007 seconds

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

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