永洪社区

标题: 数据集select字段加入参数报错 [打印本页]

作者: ruiruixxxx    时间: 2021-12-7 15:59
标题: 数据集select字段加入参数报错
数据集代码如下:
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字段中时,刷新数据集报错。求原因






作者: 环环    时间: 2021-12-7 16:12
本帖最后由 永洪Tech-chunyu 于 2021-12-7 17:20 编辑

这个用法不能在select中使用,只能跟在from后面
作者: ruiruixxxx    时间: 2021-12-7 17:12
谢谢,搞定了 ,可以放在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
永洪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>




欢迎光临 永洪社区 (http://club.yonghongtech.com/) Powered by Discuz! X3.4