帆软report中参数写法不对

${if(len(region)=0," ","and t1.region = '"+region+"'")}

${if(len(company)=0," ","and t1.company = '"+company+"'")}

${if(len(company)=0 and len(region)=0 ," ","and  coalesce(t1.region,'')='""' and coalesce(t1.company,'') = '""' ")}问题在第三个if条件这里,题主本意是想 company 和region 都为空的时候,sql应该显示成   

  and coalesce(t1.region,'') = ''  and coalesce(t1.company,'') = ''

放到第三个条件语句里面,我应该加转义字符吗?

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

${if(len(company)=0&&len(region)=0," ","and  coalesce(t1.region,'')='' and coalesce(t1.company,'') = '' ")}

  • 帆软不知名用户 帆软不知名用户(提问者) 谢谢老哥,我试了一下,用and的话就显示不出来参数,得要用&&才会显示参数
    2023-07-12 14:14 
最佳回答
0
Z4u3z1Lv6专家互助
发布于2023-7-12 14:08(编辑于 2023-7-12 14:10)

${if(and(len(company)=0 ,len(region)=0 )," ","and  coalesce(t1.region,'')='' and coalesce(t1.company,'') = '' ")}

最佳回答
0
jenniferjunLv5初级互助
发布于2023-7-12 14:13

${if(and(len(company)=0 ,len(region)=0 )," and  coalesce(t1.region,'')='' and coalesce(t1.company,'') = ''","")}

  • 2关注人数
  • 263浏览人数
  • 最后回答于:2023-7-12 14:13
    请选择关闭问题的原因
    确定 取消
    返回顶部