[报错信息处理] 数据集select字段加入参数报错

ruiruixxxx青铜四 显示全部楼层 发表于 2021-12-7 15:59:31 |阅读模式 打印 上一主题 下一主题
1
未解决
数据集代码如下:
select tcom4,tcomname4,dwm_sdate,dwm_prem
, <Enddate>?{Enddate} </Enddate> as mydate
from dwm_prem_day
where 1 = 1
<Begdate> and  dwm_sdate>=  ?{Begdate} </Begdate>
<Enddate> and  dwm_sdate<=  ?{Enddate} </Enddate>


当把<Enddate>?{Enddate} </Enddate> 加入select字段中时,刷新数据集报错。求原因





回复

使用道具 举报

精彩评论4

环环白银三 显示全部楼层 发表于 2021-12-7 16:12:59
本帖最后由 永洪Tech-chunyu 于 2021-12-7 17:20 编辑

这个用法不能在select中使用,只能跟在from后面
回复

使用道具 举报

ruiruixxxx青铜四 显示全部楼层 发表于 2021-12-7 17:12:50
谢谢,搞定了 ,可以放在select里,但要指定类型,并且把参数把字段包起来
select tcom4,tcomname4,dwm_sdate,dwm_prem
,<Enddate> case when  to_char(a.dwm_sdate,'yyyy-Q') = to_char(cast (?{Enddate} as date),'yyyy-Q') then a.dwm_prem else 0 end </Enddate> as quarter_prem
from dwm_prem_day
where 1 = 1
<Begdate> and  dwm_sdate>=  ?{Begdate} </Begdate>
<Enddate> and  dwm_sdate<=  ?{Enddate} </Enddate>


回复

使用道具 举报

ruiruixxxx青铜四 显示全部楼层 发表于 2021-12-7 17:13:28
永洪Tech-chunyu 发表于 2021-12-7 16:12
这个用法不能在select中使用,只能跟在from后面

谢谢,搞定了 ,可以放在select里,但要指定类型,并且把参数把字段包起来
select tcom4,tcomname4,dwm_sdate,dwm_prem
,<Enddate> case when  to_char(a.dwm_sdate,'yyyy-Q') = to_char(cast (?{Enddate} as date),'yyyy-Q') then a.dwm_prem else 0 end </Enddate> as quarter_prem
from dwm_prem_day
where 1 = 1
<Begdate> and  dwm_sdate>=  ?{Begdate} </Begdate>
<Enddate> and  dwm_sdate<=  ?{Enddate} </Enddate>
回复

使用道具 举报

高级模式
您需要登录后才可以回帖 登录 | 免费注册

  • 官方微信

    欢迎关注永洪服务号!收费为0,价值无限

    扫码关注
  • 新浪微博

    让每位用户轻松挖掘数据价值!

    访问新浪微博
  • 智能客服
50W

会员等你来哦

Copyright   ©2012-2024  北京永洪商智科技有限公司  (京ICP备12050607) 京公网安备110110802011451号 |联系社区管理员|《永洪社区协议》
返回顶部