新人finereport求助

linxi_hwx 2020-09-11 10:22:29
请教下各位老师,要用数据集参数刷选出某个时间段的数据,写的sql是这样的select * from cxhnweixin.FPV_FARM_PAY_VOUCHER
where status ='finish'
${if(len(starttime)=0,""," and finish_time>='"+starttime+"'")}
${if(len(endtime)=0,""," and finish_time<'"+endtime+"'")}
但是设置参数后显示文字与格式字符串不匹配,看了下数据,里面的finish_time格式是yyyy-MM-dd HH-mm-ss,我估计是我时间格式没设置好,但是又不知道怎么设置,来请教下各位老师(纯新人自己看教程摸索,无人教,小白地方请见谅)
...全文
102 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
linxi_hwx 2020-09-11
  • 打赏
  • 举报
回复
表里面是有很多时间数据,要求是以两个时间作为参数,通过控件修改这两个时间来显示出这两个时间之间的数据
linxi_hwx 2020-09-11
  • 打赏
  • 举报
回复
已解决
select * from cxhnweixin.FPV_FARM_PAY_VOUCHER
where status ='finish'
and finish_time >= cast(to_date('${starttime}','yyyy-mm-dd hh24:mi:ss') as timestamp)
and finish_time < cast(to_date('${endtime}','yyyy-mm-dd hh24:mi:ss') as timestamp)
order by finish_time

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧