直接sql账表,存储过账定义发布报表后前台无法显示过滤...
金蝶云社区-CallmeJason
CallmeJason
0人赞赏了该文章 525次浏览 未经作者许可,禁止转载编辑于2016年08月10日 10:46:28

书写了一个存储过程:
create proc pr_hk(@f_htno varchar(30))
as
go
with table1 as
(
select FCONTACTUNIT,ltrim(rtrim(F_HTNO)) as F_HTNO,
case when MONTH(FDATE)=1 then FREALRECAMOUNT end as month_1
from T_AR_RECEIVEBILL
where FCONTACTUNITTYPE='BD_Customer' and F_HTNO<>'' and FISINIT=0
--and F_HTNO=@f_htno
),
table2 as
(
select FCONTACTUNIT,ltrim(rtrim(F_HTNO)) as F_HTNO,
case when MONTH(FDATE)=2 then FREALRECAMOUNT end as month_2
from T_AR_RECEIVEBILL
where FCONTACTUNITTYPE='BD_Customer' and F_HTNO<>'' and FISINIT=0
and F_HTNO=@f_htno
)

select * from table1 a inner join table2 b on a.FCONTACTUNIT=b.FCONTACTUNIT and a.F_HTNO=b.F_HTNO
where a.F_HTNO=@f_htno
go

然后定义了调用存储过程的sql账表



您的鼓励与嘉奖将成为创作者们前进的动力,如果觉得本文还不错,可以给予作者创作打赏哦!

请选择打赏金币数 *

10金币20金币30金币40金币50金币60金币
可用金币: 0