首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SSRS无法更新查询的字段列表

SSRS无法更新查询的字段列表
EN

Stack Overflow用户
提问于 2015-07-06 13:34:04
回答 1查看 8.3K关注 0票数 0

我正在尝试创建一个报告,但我的查询似乎造成了问题,尽管它在RapidSQL8.5上运行良好。具体错误消息如下:

无法更新查询的字段列表。验证是否可以连接到数据源,以及查询语法是否正确。无效列名“MMTEST%”。 若要继续而不更新字段列表,请单击“确定”。

我的查询如下:

代码语言:javascript
复制
select count(*), No.mm_territorynumber as NO,usr.domainname, usr.systemuserid, usr.fullname, usr.mm_PrimaryTeamIdName as PrimaryTeamName
from systemuser usr WITH (nolock) 
inner join dbo.teammembership mem with (nolock) on mem.systemuserid = usr.systemuserid
inner join dbo.team team with (nolock) on team.teamid = mem.teamid and mm_teamcategorycode is not null
inner join BusinessUnit  bu WITH (nolock)  on usr.BusinessUnitId = bu.BusinessUnitId
inner join BusinessUnit NO  WITH (nolock)  on NO.BusinessUnitId = bu.mm_GUID
where usr.systemuserid in (
select usr.systemuserid from systemuser usr WITH (nolock) 
inner join dbo.teammembership mem with (nolock) on mem.systemuserid = usr.systemuserid
inner join dbo.team team with (nolock) on team.teamid = mem.teamid
and mm_teamcategorycode = '930750004'
where usr.isdisabled = 0 
intersect 
select usr.systemuserid from systemuser usr WITH (nolock) 
inner join dbo.teammembership mem with (nolock) on mem.systemuserid =      usr.systemuserid
inner join dbo.team team with (nolock) on team.teamid = mem.teamid
and mm_teamcategorycode = '930750000'
where usr.isdisabled = 0
) and
"MMTEST%" not in (select usr.domainname from systemuser usr) and
--usr.domainname not like "MMTEST%" and
usr.systemuserid = team.AdministratorId  -- Only team adminstrators
group by No.mm_territorynumber, usr.domainname, usr.systemuserid, usr.fullname, usr.mm_PrimaryTeamIdName
having count(*) = 2
order by NO.mm_territorynumber, usr.fullname;

我已经做了一些研究,以确保我的具体问题没有得到回答。下面是我访问过的一些链接:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/db1d1298-e5a9-4d4f-949e-aa570ccc6db3/ssrs-could-not-update-list-of-fields-for-the-query

https://social.msdn.microsoft.com/forums/sqlserver/en-US/96bca97a-e658-4f03-a246-5c8ae5e71c7b/could-not-create-a-list-of-fields-for-the-query

could not create a list of fields for the query

http://www.sqlchick.com/entries/2012/2/6/workaround-for-could-not-update-a-list-of-fields-for-the-que.html

有没有某个地方我不小心多次选择了一个列?在回顾了我的代码之后,情况似乎并非如此,但我对SQL也非常陌生,因此可能会出现一些我不理解的控制流问题。任何帮助都将不胜感激。

编辑: MMTEST%似乎是作为一个列创建的,但我不知道为什么会这样。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-06 14:45:41

使用单引号而不是双引号过滤出值中的特定单词。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31247261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档