语法错误。。。
SELECT MonthReport.OBJECT_KEY,MonthReport.ApprovalResult,MonthReport.factoryKey,MonthReport.ReportDate,MonthReport.CoalPowderlConsumption,MonthReport.CoalPowderHeat,PL_SITE.SITE_NAME,PL_SITE.SITE_NUMBER,PL_CELL.SEQUENCE,PL_CELL.CELL_NAME,PL_CELL.CELL_NUMBER,PL_CELL.DAILY_CAPACITY 
FROM dbo.[MonthReport] 
LEFT JOIN PL_SITE ON MonthReport.factoryKey = PL_SITE.OBJECT_KEY 
LEFT JOIN PL_CELL ON MonthReport.prodLineKey = PL_CELL.DCS_NUMBER 
where ApprovalLevel=2 
${if(type='year', " and year(dbo.[MonthReport].ReportDate)  = '" + 年+"'", "")}
${if(len(公司名称) == 0,""," and SITE_NAME in ('" + 公司名称 + "')")}

这段代码是好用的,但是我只不过在where的后面加了一句order by SEQUENCE (因为要求按顺序显示),报表就显示不了了,预览数据是可以的,一运行就报错。。。这到底是什么鬼。。。image.png

FineReport 故事的小黄瓜 发布于 2018-12-5 11:17
1min目标场景问卷 立即参与
回答问题
悬赏:4 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
axingLv6专家互助
发布于2018-12-5 11:25

where后面直接加?加在整个语句后面

blob.png

  • 2关注人数
  • 410浏览人数
  • 最后回答于:2018-12-5 11:25
    请选择关闭问题的原因
    确定 取消
    返回顶部