纯纯帆软小白,咨询一下各位大佬怎么根据开始日期和截止日期查询这一段时间内的数据
日期控件.cpt.zip
-- 下载demo解压,参考学习即可;
日期控件-https://help.fanruan.com/finereport/doc-view-258.html
——————————————————————
可以通过sql查询语句后拼接 where crt_time>${starttime} and crt_time<${endtime} ,然后starttime和endtime可以根据新建变量赋值给查询控件即可。
一、sql数据集中添加参数
1)参数为空时不做限制
where
1=1
${if(len(starttime)=0,""," and time_str>='"+starttime+"'")}
${if(len(endtime)=0,""," and time_str<='"+endtime+"'")}
2)日期参数不允许为空
where time_str between '${starttime}' and '${endtime}'
二、在查询页面添加日期查询参数