一 select * from ldy where 1=1 and goodDate > '2008'
二 select * from ldy where 1=1 and goodDate > '20080506'
三 select * from ldy where 1=1 and goodDate > '200804'前两条都能查出来,
为什么,第三条的结果为空。
二 select * from ldy where 1=1 and goodDate > '20080506'
三 select * from ldy where 1=1 and goodDate > '200804'前两条都能查出来,
为什么,第三条的结果为空。
楼主【ldy214】截止到2008-06-30 11:53:11的历史汇总数据(不包括此帖):
发帖数:50 发帖分:1265
结贴数:50 结贴分:1265
未结数:0 未结分:0
结贴率:100.00% 结分率:100.00%
敬礼!
我记得要么是年,要么是年月日吧
1 select * from ldy where 1=1 and goodDate > '20080430' 这样不行吗?2 select * from ldy where 1=1 andCONVERT(varchar(6),goodDate ,112) > '200804'
我用,select * from ldy where 1=1 and goodDate > '20080401' and goodDate < '20080431'
就可以了,结贴。