Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql SSRS 2008查询在SSRS中返回的结果与直接在Management Studio中返回的结果不同_Sql_Reporting Services - Fatal编程技术网

Sql SSRS 2008查询在SSRS中返回的结果与直接在Management Studio中返回的结果不同

Sql SSRS 2008查询在SSRS中返回的结果与直接在Management Studio中返回的结果不同,sql,reporting-services,Sql,Reporting Services,希望有人能帮忙。我在SSRS 2008中有一个订单打印报告,当我直接在Mgmt Studio中的查询中运行它时,该报告返回了正确的结果,但SSRS中的同一个查询不正确。我已经将我使用的查询简化为几个表,以使其更简单。这只是我的SSRS数据集中的一个文本查询: select o.order_num, ol.prod_num, ol.prod_desc1 as com1, ol.prod_desc2 as com2 from [order] o left outer join order_l

希望有人能帮忙。我在SSRS 2008中有一个订单打印报告,当我直接在Mgmt Studio中的查询中运行它时,该报告返回了正确的结果,但SSRS中的同一个查询不正确。我已经将我使用的查询简化为几个表,以使其更简单。这只是我的SSRS数据集中的一个文本查询:

select   o.order_num,  ol.prod_num,  ol.prod_desc1 as com1, ol.prod_desc2 as com2
from [order] o
left outer join order_line ol on o.order_num = ol.order_num
where o.order_num = '09182272' and **(ol.prod_desc1 NOT LIKE '*%' and ol.prod_num <> 'C')**
UNION ALL
select    o.order_num,  ol.prod_num, ol.prod_desc1 as com1, ol.prod_desc2 as com2
from [order_history] o
left outer join order_history_line ol on o.order_num = ol.order_num
where o.order_num = '09182272' and (ol.prod_desc1 NOT LIKE '*%' and ol.prod_num <> 'C')

我不想看到描述以*或prod_num=C开头的任何订单行订单详细信息行。当我在Mgmt Studio中运行它时,我不会得到这些行-但当我在SSR中运行它时,它们会返回。这两个查询的唯一区别在于,在SSRS中,o.order_num是一个参数,这里我将其硬编码。有什么想法吗?提前感谢

解决了-我必须清除缓存。我觉得这很有帮助

酷。如果你真的发布了你在其他人有同样问题时清除缓存的方法,那就太棒了。然后,别忘了在允许的情况下尽快接受你的答案。它基本上是在你的答案旁边的上/下投票按钮下的复选标记。