datetime 0.33 ms rounded problem

  • Hi,

    According to BOL the datetime field would round to 0.33 ms, but we want to store exact and accurate millisecond using datetime field such that 0.001 s and 0.002 s would not round to 0.000 s, as this rounding would cause us trouble and inconvenince for datetime comparison and calculation when communicating with other programming language(e.g. C++/Java/.Net). Is there any other alternative to solve such kind of problem? Thanks a lot.

    Best regards,

    Wallace

  • The minimum granularity of datetime is 3ms. Basically as long as you are using datetime that is as good as it gets. You could store it as a seperate field, but that is about it..

    CEWII

  • You can use Datetime2 if you are running your database in SQL 2008. It has a 100 nanoseconds accuracy.

  • Upgrade to SQL Server 2008 and use datetime2.

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

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

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