+ -
当前位置:首页 → 问答吧 → 请教reporting service 问题

请教reporting service 问题

时间:2011-11-25

来源:互联网

由于需跨数据库查询,REPORTING SERVICE好像不支持多数据源,于是数据库内建了两个视图进行跨数据库查询,两个视图用全连结关联,在数据窗口运行SQL填写参数后显示结果正确,而在预览窗口里填入参数后运行结果不正确.

select * from (select id,sum(qty) from view1 where id like @id and date >= @date group by id) a full join (select id,sum(qty) from view2 where id like @id and date >= @date group by id) b on a.id = b.id

数据窗口结果 正确

A 3 A 2
B 4 B 3  


预览窗口

A 3 A 3

B 5 B 5 
C 6 C 8 两个视图用户匹配后的数量都是一样

作者: steven_huang88   发布时间: 2011-11-25

LZ这个问题点已经写的很明确了。应该是在参数传递过程中出现了跟需求逻辑不符的地方。
LZ好好查查这个地方。

作者: OrchidCat   发布时间: 2011-11-25