J jialiguo Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-02 #1 我表中有个字段是Tdatetime的但我又要查在一段Time间的数据;怎么办
K kingsonchan Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-02 #2 什么一段Time的时间?指小时吗?那你可以用datepart(hour,field)得到小时。
S songrun Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-03 #3 日期、時間可以轉化為整數來比較查詢的,可以看看相關的轉化的帖子
D deardai Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-04 #4 select convert(char(10),getdate(),24),用convert可以截取出datetime中的time部分,
Y yunxi126 Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-04 #5 select * from tabname where tabcol='2007-06-01' 自动转换的.
J jialiguo Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-08 #6 select * from CheckDetail where convert(varchar(10),BeginTime,24)>'00:00:00' and convert(varchar(10),BeginTime,24)<'23:59:59' 这么写了,但如果BeginTime为空的话就不显示这条记录了
select * from CheckDetail where convert(varchar(10),BeginTime,24)>'00:00:00' and convert(varchar(10),BeginTime,24)<'23:59:59' 这么写了,但如果BeginTime为空的话就不显示这条记录了