c#日期时间段判断

select * from 表名 where (case when ISDATE(字段名)=1 then CONVERT(varchar(100),cast(字段名 as datetime),23) else '1000-1-1' end >'"+开始时间+"') and (case when ISDATE(字段名)=1 then CONVERT(varchar(100),cast(字段名 as datetime),23) else '3000-1-1' end >'"+接收时间+"')

猜你喜欢

转载自www.cnblogs.com/dangpengfei/p/9993303.html