我的数据表为
create table test(id int identity primary key,
logTime nvarchar(50))
通过这条语句
delete from test where convert(datetime,convert(nvarchar(50),logtime)) between '2009-06-21' and '2009-07-21'
只能删除这两个时间段内的记录
删除数据表中某个时间前的所有数据:
delete from 表名 where cast(字段名 as datetime)<'2009-07-21'