我想查12月31号以后的数据
select * from tb where stime>2007-12-31
这个语句有什么问题啊?怎么查出来连07年5月份的数据都有啊(stime字段的形式是1989-12-30 12:23:13这种格式的,DATETIME型)
高手指点下
select * from tb where stime>2007-12-31
这个语句有什么问题啊?怎么查出来连07年5月份的数据都有啊(stime字段的形式是1989-12-30 12:23:13这种格式的,DATETIME型)
高手指点下
select * from tb where convert(varchar(10),stime,120)> '2007-12-31'
select * from tb where stime> 2007-12-31
这个语句有什么问题啊?怎么查出来连07年5月份的数据都有啊(stime字段的形式是1989-12-30 12:23:13这种格式的,DATETIME型)
高手指点下 select * from tb where stime> '2007-12-31'select * from tb where convert(varchar(10),stime,120)> '2007-12-31'
2 取到天数,最好先datetime型的转成varchar()型的。