sqlDateSourse读取Calendar控件的值
如何让sqldatesourse的where语句能够读到calendar选定日期的年和月的值?
[解决办法]
select * from table where getdate() between timeStart and timeEnd
--或者
select * from table where getdate() >=timeStart and getdate()<=timeEnd
[解决办法]
select * from table where DATEPART(yy,Calendar1.SelectedDate)//根据年
select * from table where DATEPART(mm,Calendar1.SelectedDate)//根据月
貌似Calendar1.SelectedDate可以直接获取
this.Calendar1.SelectedDate.Year
this.Calendar1.SelectedDate.Month