当前位置: 代码迷 >> SQL >> sqlserver字符串当天期用
  详细解决方案

sqlserver字符串当天期用

热度:125   发布时间:2016-05-05 15:06:17.0
sqlserver字符串当日期用

通用就是在某些情况下,字符串可以当日期用。

见以下一个例子例1:

?

select * from stage.dbo.dApplicationStat where Timestamp between '2012-02-22 00:00:00' and '2012-02-22 23:59:59'--time类型的完全可以用字符串来检索。。。忽忽
?

此类中,timerstamp是datetime型的。

?

?

例2:

insert into dApplicationStat(timestamp) values('2012-02-22 01:00:00')

?同上,timestamp依然是datetime型。。

?

但是我不知道具体原理是什么,反正只是实际中的一些经验吧,遇到了再总结。

  相关解决方案