SSRS - 将参数用作数据集/报表查询的一部分

时间:2016-05-12 21:46:29

标签: reporting-services

我正在尝试使用以下数据集查询运行SSRS报告:

SELECT        timesheet_entry.ASSIGNMENT_ID, timesheet_entry.ENTRY_DATE, timesheet_entry.UPDATE_DATE, timesheet_entry.HOURS, timesheet_entry.COMMENT, 
                     project.PROJECT_ID, project.NAME AS Name_Of_Project, project.DESCRIPTION, project.PROJECT_MANAGER, user_to_department.DEPARTMENT_ID, 
                     user_to_department.USER_ID, users.USER_ID AS User_ID2, users.USERNAME, users.FIRST_NAME, users.LAST_NAME, 
                     users.DEPARTMENT_ID AS DEPARTMENT_ID2, users.ACTIVE AS ACTIVE2, user_department.NAME, CONCAT(Users.LAST_NAME, ", ", Users.FIRST_NAME) 
                     AS Full_Name, Customer.NAME AS Project_Cat
FROM            user_department, user_to_department, project,    Project_Assignment, Timesheet_entry, Users, Customer
WHERE (timesheet_entry.ENTRY_DATE BETWEEN (?) and (?)) AND (User_Department.NAME IN ('" & Join(Parameters!Parameter3.Value, "', '") & "'))     AND
(user_department.DEPARTMENT_ID = user_to_department.DEPARTMENT_ID) AND (project.PROJECT_ID = project_assignment.PROJECT_ID) AND 
                     (project_assignment.ASSIGNMENT_ID =  timesheet_entry.ASSIGNMENT_ID) AND (project_assignment.USER_ID = users.USER_ID)  AND 
                     (users.USER_ID = user_to_department.USER_ID) AND (Project.Customer_ID = Customer.Customer_ID) 

当我尝试运行报告时,我会收到所有列标题,但没有数据。我知道问题是我的第三个问题,它是文本参数的一部分,可以有多个值。当我用那个查询?作为一个单数值,我得到了数据。希望有人能指出我的语法是否错误。

此外,我需要在查询本身内完成此操作,将其用作数据集中的过滤器会导致报告运行时间超过预期。

提前谢谢!

0 个答案:

没有答案