且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

[已解决]如何在SQL Server中检查日期

更新时间:2022-11-01 13:10:41

select * from your_table where '01/13/2011' between startdate and enddate

OR

select * from your_table where '01/13/2011' between CONVERT(VARCHAR(10), startdate, 101) AND CONVERT(VARCHAR(10), enddate, 101)


这应该做到-
This should do it -
select * from mytable where startdate <= @myDate and enddate >= @mydate