开发者

Whiel Update ,datetime value is rounded to seconds.! i want milliseconds too

开发者 https://www.devze.com 2022-12-29 20:34 出处:网络
While upd开发者_如何学编程ating a datatime column ina table from another table, i noticed that mnilliseconds value are not shown.. instead it is rounded and the value is updated to nearest seconds.

While upd开发者_如何学编程ating a datatime column in a table from another table, i noticed that mnilliseconds value are not shown.. instead it is rounded and the value is updated to nearest seconds.

Example :

Original Value: 2008-06-26 14:06:36.643

Updated Value : 2008-06-26 14:07:00

Please help me getting the actual value including milliseconds


In the case where you're doing a straight update of a datetime in one table with one from another table (i.e. no fiddling with the value), then it sounds like the datatype in the table being updated is not the same.

i.e. in SQL Server world, it could be that you are using SMALLDATETIME column in the table being updated, but a DATETIME field in the table being copied from. SMALLDATETIME is only accurate to the second and so would show this behaviour


In SQL Server;

SELECT CAST('2008-06-26 14:06:36.643' AS SMALLDATETIME)

> 2008-06-26 14:07:00

So the destination table column is probably SMALLDATETIME (or your casting in the query).

0

精彩评论

暂无评论...
验证码 换一张
取 消