当使用Getdate()函数更新较小的日期时间字段时,第二部分不会更新 [英] When a small date time filed is updated with Getdate() function second part is not updated
本文介绍了当使用Getdate()函数更新较小的日期时间字段时,第二部分不会更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在表格中有一个小的日期时间字段。如果该字段用GetDate函数更新,则时间部分保持为零(00)。
例如 12:10:00 而不是 12:10:10
请给我一个解决方案
I have small datetime field in a table.If that field is updated with GetDate function time part remains as zero(00).
For instance 12:10:00 instead of 12:10:10
Pls give a solution
推荐答案
阅读文档: MSDN: Smalldatetime [ ^ ] < br $>
定义与一天中的时间相结合的日期。时间基于24小时制,秒数始终为零(:00)并且没有小数秒。
所以你所看到的正是数据类型所期望的行为。
Read the documentation: MSDN: Smalldatetime[^]
"Defines a date that is combined with a time of day. The time is based on a 24-hour day, with seconds always zero (:00) and without fractional seconds."
So what you are seeing is exactly the behaviour expected of the data type.
这篇关于当使用Getdate()函数更新较小的日期时间字段时,第二部分不会更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文