当我尝试在SSRS IDE中设置数据集时,我得到您在快照中看到的错误.
查询在SQL Server Management Studio中完全正常,我想知道我哪里出错?!
与DB的连接已经建立.

可选的:
如果你想查看我的查询(它太长),我检查得很好.它没有错:
SELECT Customer.customerID, Customer.companyName, CustomerInvoice.dueDate, CustomerInvoice.cuInvoiceID, CustomerQuote.PONumber, Product.productName, CASE WHEN (SELECT isTaxPaid
FROM SupplierQuoteProducts
WHERE productID = CustomerQuoteProducts.ProductID) = 1 THEN CustomerQuoteProducts.unitPrice * 1.15
WHEN (SELECT isTaxPaid
FROM SupplierQuoteProducts
WHERE productID = CustomerQuoteProducts.ProductID) = 0 THEN CustomerQuoteProducts.unitPrice
ELSE CustomerQuoteProducts.unitPrice
END AS "unitPrice",
CustomerQuoteProducts.qty, CustomerQuoteProducts.isTaxPaid, PaymentMethod.paymMethDesc, CustomerInvoice.customerQuoteID, CustomerInvDetail.paidDate, CustomerInvDetail.clearedDate,
CustomerInvDetail.notes, CustomerInvDetail.sentDate, PaymentExpected.payExpectedTitle, PaymentStatus.paymentStatusTitle,
CASE WHEN
(SELECT isTaxPaid
FROM SupplierQuoteProducts
WHERE productID = CustomerQuoteProducts.ProductID) = 1 AND CustomerQuoteProducts.qty > 0 AND
CustomerQuoteProducts.isTaxPaid > 0 …Run Code Online (Sandbox Code Playgroud) 我在 Visual Studio 2015 和 SQL Server 2014 中使用 SSRS/SSDT。有一个错误已经存在了超过 8 年,您无法从具有相同名称的不同表中选择多个列。为了解决这个问题,我需要使用子查询。我找到的每个答案都会重写给定的查询以删除子查询,这通常很好,但在这种情况下不适用。如何将参数传递给 SQL Server 中的子查询?
列别名不适用于此错误 -AS即使它适用于所有其他列,但使用也会在“重复”列上返回未知列错误。该SELECT子句中的最后两行之所以有效,是因为正在查询这些值,以便报表可以使用它们,但实际查询的其余部分不使用它们。
这是我当前的代码(不起作用,因为子查询返回多行)。
SELECT t.[Description],
t.RequestedCompletionDate,
t.CommitDate,
t.StatusId,
t.PriorityId,
p.ProjectNumber,
s.Name AS StatusDescription,
pr.Name AS PriorityDescription
FROM ProjectTask t
inner join Project p
on p.Id = t.ProjectId
inner join Project_TaskStatus s
on s.Id = t.StatusId
inner join Project_Priority pr
on pr.Id = t.PriorityId
WHERE t.Type = 'ET'
AND t.StatusId NOT IN (4,7)
AND
(
SELECT StatusId FROM …Run Code Online (Sandbox Code Playgroud)