cloud 6.0想通过sql server存储过程制作一个直接SQL 报表,但是在报表制作完成测试时总是报错,老师指导一下是哪里的问题?
语句如下:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:
-- Create date:
-- Description: <采购汇总表,,>
-- =============================================
alter PROCEDURE hy_cghzb
@gysks varchar(100),
@FDateks varchar(100),
@FDatejs varchar(100)
AS
BEGIN
SET NOCOUNT ON;
create table #hycghz
( zzdm varchar(100),
cgzz varchar(100),
wldm varchar(100),
wlmc varchar(100),
ggxh varchar(100),
cgdw varchar(100),
slsl decimal(18,4) default(0),
bhgtlsl decimal(18,4) default(0),
rksl decimal(18,4) default(0),
rkje decimal(18,2) default(0),
tlsl decimal(18,4) default(0),
tlje decimal(18,2) default(0)
)
--取收料通知单数据为送料数量
insert into #hycghz(zzdm,cgzz,wldm,wlmc,ggxh,cgdw,slsl)
select o.fnumber,o1.fname,a.fnumber,b.fname,b.fspecification,c.fname,sum(u1.FACTRECEIVEQTY )
from T_PUR_Receive v inner join T_PUR_ReceiveENTRY u1 on v.fid=u1.fid
--left join T_STK_INSTOCKENTRY_F u2 on u1.fid=u2.fid and u1.FENTRYID=u2.FENTRYID
left join T_ORG_Organizations o on o.forgid=v.FStockOrgId
left join T_ORG_Organizations_L o1 on o.forgid=o1.forgid
left join T_BD_MATERIAL a on a.FMATERIALID=u1.FMATERIALID
inner join T_BD_MATERIAL_L b on a.FMATERIALID=b.FMATERIALID
left join T_BD_MATERIALSTOCK d on d.FMATERIALID=a.FMATERIALID
left join t_BD_Unit_L c on c.FUNITID=d.fstoreunitid
left join t_BD_Supplier g on g.FSUPPLIERID=v.FSUPPLIERID
left join t_BD_Supplier_l g1 on g.fsupplierid=g1.fsupplierid
--left join t_BD_Stock_L k on k.fstockid=u1.fstockid
where 1=1 and o.fdocumentstatus='C'
and v.fdate>='@FDateks'
and v.fdate<='@FDatejs'
and g1.fname like '%'+@gysks+'%'
group by o.fnumber,o1.fname,a.fnumber,b.fname,b.fname,b.fspecification,c.fname
select * from #hycghz
drop table #hycghz
END
GO
推荐阅读