0

I am seeing a very strange issue in SQL server, when converting to a datetime the milliseconds are not correct -

When I run -

SELECT CONVERT(DATETIME, '09/10/2013 16:09:47.935', 103)

It returns -

2013-10-09 16:09:47.937

Am I missing something? Or has anyone seen this issue before?

user1948635
  • 1,357
  • 4
  • 15
  • 22
  • 3
    http://stackoverflow.com/questions/634122/milliseconds-wrong-when-converting-from-xml-to-sql-server-datetime – klugerama Oct 09 '13 at 16:06
  • 1
    Ah, didn't know that. Have since found that DATETIME2 is more accurate. How I have been using SQL for 8 years without knowing about that I will never know... And thankyou. – user1948635 Oct 09 '13 at 16:07

1 Answers1

0

Turns out this solves the problem -

SELECT CONVERT(DATETIME2, '09/10/2013 16:09:47.935', 103)
user1948635
  • 1,357
  • 4
  • 15
  • 22