请教一下这里为什么会报语法错误

select a.id,

       CONVERT(varchar(7),a.salesDate,120) as 流向日期,

       a.salesDate as 销售日期,

       a.salesAmount as 销售数量,

  a.createTime as 导入日期,

       a.batchNumber as 批次号,

       b.customername as 上游商业客户,

       d.customername as 下游商业客户,

  c.id as 产品ID,

  c.requirementname as 品名品规,

  a.entId as 上游商业客户ID,

  a.endentId as 下游商业客户ID 

from yd_import_main_data a,yd_customer b,yd_product c,yd_customer d

where a.entId = b.id and a.endentId = d.id and a.productId = c.id

--and a.flowMonth between '${begindate}' and '${enddate}'

${if(len(customerid)=0,""," and a.entid = '"+customerid+"'")}

${if(len(productid)=0,""," and a.productid = '"+productid+"'")}

${if(len(begindate)=0,""," and a.salesDate >= '"+begindate+"'")}

${if(len(enddate)=0,""," and a.salesDate <= '"+enddate+"'")}

${if(len(createTime)=0,""," and a.createTime = '"+createTime+"'")}

QQ图片20190813094316.png

F759504015 发布于 2019-8-13 09:43
1min目标场景问卷 立即参与
回答问题
悬赏:4 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
zsh331Lv8专家互助
发布于2019-8-13 10:01

结果QQ沟通,楼主的二个控件为多选控件。


${if(len(customerid)=0,""," and a.entid in ('"+customerid+"')")}


 ${if(len(productid)=0,""," and a.productid in ('"+productid+"')")}


下拉复选框实现多值查询-http://help.finereport.com/finereport9.0/doc-view-1865.html


  • firegunzx firegunzx 我说看了半天怎么没发现语法错误呢
    2019-08-13 10:16 
最佳回答
0
ever123Lv4见习互助
发布于2019-8-13 09:52(编辑于 2019-8-13 10:00)

select a.id,

       CONVERT(varchar(7),a.salesDate,120) 流向日期,

       a.salesDate  销售日期,

       a.salesAmount  销售数量,

  a.createTime  导入日期,

       a.batchNumber  批次号,

       b.customername 上游商业客户,

       d.customername  下游商业客户,

  c.id  产品ID,

  c.requirementname  品名品规,

  a.entId  上游商业客户ID,

  a.endentId  下游商业客户ID 

from yd_import_main_data a,yd_customer b,yd_product c,yd_customer d

where a.entId = b.id and a.endentId = d.id and a.productId = c.id

--and a.flowMonth between '${begindate}' and '${enddate}'

${if(len(customerid)=0,""," and a.entid = '"+customerid+"'")}

${if(len(productid)=0,""," and a.productid = '"+productid+"'")}

${if(len(begindate)=0,""," and a.salesDate >= '"+begindate+"'")}

${if(len(enddate)=0,""," and a.salesDate <= '"+enddate+"'")}

${if(len(createTime)=0,""," and a.createTime = '"+createTime+"'")}

试一下,有问题再看看,最后一个是日期吧

${if(len(createTime)=0,""," and trunc(a.createTime) =to_date('"+createTime+"','yyyy/mm/dd')")}


  • 3关注人数
  • 626浏览人数
  • 最后回答于:2019-8-13 10:01
    请选择关闭问题的原因
    确定 取消
    返回顶部