FR数据集里的两个参数怎么写成一样的呀

怎么会变成四个参数呀,重复了,请教下,这个怎么写成一致的

image.png

SELECT

${=if(MONTH(START_DATE)=MONTH(END_DATE),

(day(END_DATE)-day(START_DATE))/DAYSOFMONTH(START_DATE)*26,

(DAYSOFMONTH(START_DATE)-day(START_DATE)+1)/DAYSOFMONTH(START_DATE)*26+(day(END_DATE)-day(DATEINMONTH(END_DATE,1))+1)/DAYSOFMONTH(END_DATE)*25)},

a.DEPARTMENT_ID,

b.DEPARTMENT_NAME,

--SUM ( SaleNum ) SaleNum,

SUM ( a.EAT_SALEMONEY ) '外带折前总营收'

FROM

[dbo].[EAT_DAYXFBMINFO] a,

ORG_DEPARTMENT b 

WHERE

a.DEPARTMENT_ID= b.DEPARTMENT_ID 

AND a.RPT_DATE BETWEEN '${START_DATE}' 

AND '${END_DATE}' 

AND a.CHANNEL_ID IN ( SELECT CHANNEL_ID FROM [dbo].[STK_CHANNEL] WHERE Eat_ParentID = '1a5b440b-1b8a-42fe-9103-a0caca80f0f0' AND STATUS = '1' ) 

AND a.Eat_XFBMID NOT IN ( SELECT Eat_XFBMID FROM [dbo].[EAT_XFBM] WHERE Eat_XFName LIKE '%端午礼盒22%' OR Eat_XFName LIKE '%端午礼包22%' OR Eat_XFName = '粽子礼盒180元' ) 

 

GROUP BY

a.DEPARTMENT_ID,b.DEPARTMENT_NAME

FineReport 猫头鹰的头 发布于 2022-5-30 17:48 (编辑于 2022-5-30 18:01)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共2回答
最佳回答
0
CD20160914Lv8专家互助
发布于2022-5-30 17:51(编辑于 2022-5-30 18:04)

蓝色的位置去掉$

这个=号不能要

SELECT

${if(MONTH(START_DATE)=MONTH(END_DATE),

(day(END_DATE)-day(START_DATE))/DAYSOFMONTH(START_DATE)*26,

(DAYSOFMONTH(START_DATE)-day(START_DATE)+1)/DAYSOFMONTH(START_DATE)*26+(day(END_DATE)-day(DATEINMONTH(END_DATE,1))+1)/DAYSOFMONTH(END_DATE)*25)} as 数据,

a.DEPARTMENT_ID,

b.DEPARTMENT_NAME,

--SUM ( SaleNum ) SaleNum,

SUM ( a.EAT_SALEMONEY ) '外带折前总营收'

FROM

[dbo].[EAT_DAYXFBMINFO] a,

ORG_DEPARTMENT b 

WHERE

a.DEPARTMENT_ID= b.DEPARTMENT_ID 

AND a.RPT_DATE BETWEEN '${START_DATE}' 

AND '${END_DATE}' 

AND a.CHANNEL_ID IN ( SELECT CHANNEL_ID FROM [dbo].[STK_CHANNEL] WHERE Eat_ParentID = '1a5b440b-1b8a-42fe-9103-a0caca80f0f0' AND STATUS = '1' ) 

AND a.Eat_XFBMID NOT IN ( SELECT Eat_XFBMID FROM [dbo].[EAT_XFBM] WHERE Eat_XFName LIKE '%端午礼盒22%' OR Eat_XFName LIKE '%端午礼包22%' OR Eat_XFName = '粽子礼盒180元' ) 

 

GROUP BY

a.DEPARTMENT_ID,b.DEPARTMENT_NAME

最佳回答
0
ColdmanLv6高级互助
发布于2022-5-30 17:50

image.png这里的去掉$

  • 3关注人数
  • 352浏览人数
  • 最后回答于:2022-5-30 18:04
    请选择关闭问题的原因
    确定 取消
    返回顶部