where条件中参数语句问题

参数SQL问题

${if(substr(starttime,9,10)='06',"AND LY.TIMEKEY >= substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '0600000000'","AND LY.TIMEKEY >= substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '1800000000'")}

${if(substr(starttime,9,10)='06',"AND LY.TIMEKEY < substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '1800000000'","AND LY.TIMEKEY < substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '0600000000'")}

将此放置where条件中,在帆软报表预览时,报错:数据集配置错误,出现不支持的SQL92 标记:493

为什么会报这个错?那个位置写错了?各位大佬帮忙指点下

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

${if(mid(starttime,9,10)='06',"AND LY.TIMEKEY >= substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '0600000000'","AND LY.TIMEKEY >= substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '1800000000'")}

${if(mid(starttime,9,10)='06',"AND LY.TIMEKEY < substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '1800000000'","AND LY.TIMEKEY < substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '0600000000'")}

判断条件哪里要用帆软公式,在“”引号里面可以数据库函数

最佳回答
0
shirokoLv6资深互助
发布于2025-4-16 10:49

${if(MID(starttime,9,10)='06',"AND LY.TIMEKEY >= '"+MID(starttime,1,4)+"'||'"+MID(starttime,6,2)+"'||'"+MID(starttime,9,2)+"' || '0600000000'","AND LY.TIMEKEY >= '"+MID(starttime,1,4)+"'||'"+MID(starttime,6,2)+"'||'"+MID(starttime,9,2)+"' || '1800000000'")}

${if(MID(starttime,9,10)='06',"AND LY.TIMEKEY < '"+MID(starttime,1,4)+"'||'"+MID(starttime,6,2)+"'||'"+MID(starttime,9,2) +"'|| '1800000000'","AND LY.TIMEKEY < '"+MID(starttime,1,4)+"'||'"+MID(starttime,6,2)+"'||'"+MID(starttime,9,2)+"' || '0600000000'")}

最佳回答
0
华莉星宸Lv7资深互助
发布于2025-4-16 10:55

${if(mid(starttime,9,2)='06',"AND LY.TIMEKEY >= substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '0600000000'","AND LY.TIMEKEY >= substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '1800000000'")}

${if(mid(starttime,9,2)='06',"AND LY.TIMEKEY < substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '1800000000'","AND LY.TIMEKEY < substr('"+starttime+"',1,4)||substr('"+starttime+"',6,2)||substr('"+starttime+"',9,2) || '0600000000'")}

最佳回答
0
jokerGGLv5见习互助
发布于2025-4-16 11:07

replace(substr('"+starttime+"',1,10),'-','')

  • 5关注人数
  • 47浏览人数
  • 最后回答于:2025-4-16 11:07
    请选择关闭问题的原因
    确定 取消
    返回顶部