select * from H_CheckUserInfo hcui
where substring(convert(varchar(20),hcui.checkdatetime,20),0,11)='2008-9-21'
我这样写为什么查不出来东西呢?
请指教。。谢谢。
where substring(convert(varchar(20),hcui.checkdatetime,20),0,11)='2008-9-21'
我这样写为什么查不出来东西呢?
请指教。。谢谢。
调试欢乐多
where substring(convert(varchar(20),hcui.checkdatetime,20),0,11)='2008-09-21'
这样试试,是不是字符串截取有错误?
where hcui.checkdatetime between '2008-9-21' end '2008-9-22'
为啥要这样取呢
where hcui.checkdatetime >= '2008-9-21' and hcui.checkdatetime < '2008-9-22'不行么
convert(char(10),AddDate,120) ='2008-9-22'
这样就行
where convert(varchar(20),hcui.checkdatetime,23) as checkdatetime ='2008-9-21'