SQL查询 某日期字段在两个日期字段之间的数据···

2025-04-19 19:02:41
推荐回答(3个)
回答1:

用convert(date)将datetime转成date然后直接比较。

回答2:

select * from table where adate

回答3:

你就转下不行吗?
where CONVERT(varchar(100), adate, 25) between CONVERT(varchar(100), bdate, 25) and CONVERT(varchar(100), cdate, 25)