由于某种原因,我的参数不会过滤我的报告。我有2个不同表的3个数据集。一个数据集是Project,一个是Issue,最后一个是参数将为名为SelectProject的值引用的数据集,并添加了以下值:
SELECT DISTINCT ProjectName, ID
FROM Project
参数名称为:SelectProject。
我的项目数据集如下所示:
SELECT Project.ProjectCode, Project.ProjectName,
Project.ProjectDescription, Project.ID, ProjectSponsorIDText,
FROM Project
WHERE (Project.ID IN (@SelectProject))
问题数据集出现了问题。
SELECT Issue.IssueName, Issue.ID, Issue.RelatedRisk,
Issue.Project, Issue.RaisedBy, Issue.Description,
Issue.Impact, Issue.ImpactDescription
FROM Issue
INNER JOIN
Project ON Issue.ID=Project.ID
WHERE (Project.ID IN (@SelectProject))
出于某种原因,它不会根据我的问题表过滤掉,只留下我的空表。 有什么我想念的吗?
答案 0 :(得分:3)
您应该使用Issue.Project字段加入您的问题:
SELECT Issue.IssueName, Issue.ID, Issue.RelatedRisk,
Issue.Project, Issue.RaisedBy, Issue.Description,
Issue.Impact, Issue.ImpactDescription
FROM Issue
INNER JOIN Project ON Issue.Project = Project.ID
WHERE Project.ID = @SelectProject