金蝶KIS BOS 实例讲解(续)
新增报表名称好后开始到输入SQL语句了..
SQL语句最好在查询分析器调试好后再进行粘贴....
语句如图:
源码:
Set Nocount On
select IDENTITY(int,1,1)AS ID,,sum(fqty) fqty,
sum(famount) famount INTO #
from icstockbill v1,
icstockbillentry v2,t_department t3,t_emp t4,t_stock t8
where = and
= and ='21' and ='1' and
= and =
and {strfdatefrom} and {strfdateto}---
这里是时间过滤所需要的。
and {strfnumberfrom} and {strfnumberto}---这里是职员代码过滤所用到的
group by order by desc
select
case when '第'+cast((case when id=1 then id else id end)as varchar)+'名'='第1名'
then '销售冠军' else '第'+cast((case when id=1 then id else id end)as varchar)+'名'
end as uid
,fname,fqty,famount
from #
drop table #
下一步如图:
下一步: 如图
完成:
然后导出报表:
导入\发布报表到专业版看效果....
导
金蝶KIS BOS 实例讲解(续) 来自淘豆网m.daumloan.com转载请标明出处.