如下所示,我现在已经能判断周末和工作日了,怎么加上日期区间呀,就是我选择一个开始日期和结束日期,然后点击工作日或者周末,从而实现查询功能,还有一个就是如果不选周末和工作日,就是查询所选的全部日期了 SELECT TOP 100 RPT_DATE,datepart(weekday,RPT_DATE) as 星期 FROM [dbo].[EAT_DAYPAYINFO] where 1=1 ${switch(p1,"周末","and datepart(weekday,RPT_DATE) in(1,7)","工作日", "and datepart(weekday,RPT_DATE) in(2,3,4,5,6)")} |