麻烦帮我看看这个错在哪里,可以这样用吗?提示我报错。

image.png

FineReport 用户jGnXs7014103 发布于 2022-6-10 11:22 (编辑于 2022-6-10 11:35)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共3回答
最佳回答
0
snrtuemcLv8专家互助
发布于2022-6-10 11:28(编辑于 2022-6-10 11:35)

你的sql肯定有问题,${}中还有${}

你把语句拷贝出来,帮你改。。。。

===========

${if(SFJM='全量', "select * from View_ZJGD_GXBZ_ONLY where cast([boss归档时间] as date)>='"+time+"' and cast([boss归档时间] as date)<='"+time_c+"' and [是否是校园宽带] like '%否%'", "select a.* from View_ZJGD_GXBZ_ONLY as a left join (select 工单编码 from ZJJM where cast(减免时间 as date) like left('"+time+"',7) + '%') as b on a.工单编码=b.工单编码 where b.工单编码 is null and cast([boss归档时间] as date)>='"+time+"' and cast([boss归档时间] as date)<='"+time_c+" and [是否是校园宽带] like '%否%' ")}

  • 用户jGnXs7014103 用户jGnXs7014103(提问者) ${if(${SFJM}=\'全量\', select * from View_ZJGD_GXBZ_ONLY where cast([boss归档时间] as date)>=\'${time}\' and cast([boss归档时间] as date)<=\'${time_c}\' and [是否是校园宽带] like \'%否%\', select a.* from View_ZJGD_GXBZ_ONLY as a left join (select 工单编码 from ZJJM where cast(减免时间 as date) like left(\'${time}\',7) + \'%\') as b on a.工单编码=b.工单编码 where b.工单编码 is null and cast([boss归档时间] as date)>=\'${time}\' and cast([boss归档时间] as date)<=\'${time_c}\' and [是否是校园宽带] like \'%否%\' )}
    2022-06-10 11:30 
  • snrtuemc snrtuemc 回复 用户jGnXs7014103(提问者) 看修改答案
    2022-06-10 11:36 
最佳回答
0
重庆一棵草Lv4中级互助
发布于2022-6-10 11:23

宝杀错?

  • 用户jGnXs7014103 用户jGnXs7014103(提问者) 错误代码:11300001 数据集配置错误
    Query:
    错误代码:11300001 数据集配置错误
    com.microsoft.sqlserver.jdbc.SQLServerException: “$”附近有语法错误。
    2022-06-10 11:26 
最佳回答
0
CD20160914Lv8专家互助
发布于2022-6-10 11:28(编辑于 2022-6-10 12:25)

${if(SFJM='全量',"

select * from View_ZJGD_GXBZ_ONLY where cast([boss归档时间] as date)>='"+time+"' and cast([boss归档时间] as date)<='"+time_c+"' and [是否是校园宽带] like '%否%'",

"select a.* from View_ZJGD_GXBZ_ONLY as a left join (select 工单编码 from ZJJM where cast(减免时间 as date) like '"+left(time,7)+"%') as b on a.工单编码=b.工单编码  

where b.工单编码 is null and cast([boss归档时间] as date)>='"+time+"' and cast([boss归档时间] as date)<='"+time_c+"' and [是否是校园宽带] like '%否%'"

)}

  • 用户jGnXs7014103 用户jGnXs7014103(提问者) 这样也不行
    2022-06-10 11:31 
  • CD20160914 CD20160914 回复 用户jGnXs7014103(提问者) 看我最新修改的。。我看出来的语法是没有问题的了
    2022-06-10 12:22 
  • 4关注人数
  • 368浏览人数
  • 最后回答于:2022-6-10 12:25
    请选择关闭问题的原因
    确定 取消
    返回顶部