求救,sql 水晶报表发布后,不提示输入参数
连接sql数据库,制作水晶报表,在前台发布后,不提示输入参数,请高手解答下,谢谢~~~~~~~~~~~~sql语句为:SELECTo.unitid,o.unitcodea...
连接sql数据库,制作水晶报表,在前台发布后,不提示输入参数,请高手解答下,谢谢~~~~~~~~~~~~
sql语句为:
SELECT o.unitid,o.unitcode as 部门代码,o.unitname as 部门,p.employeeid as 工号,p.truename as 姓名,正常考勤,迟到,早退,旷工,事假,病假,
婚假,丧假,产假,哺乳假,工伤假,流产假,护理假,未刷卡次数 FROM psnaccount p join (
SELECT ATDATTENDANCEDATA.personid,
sum(case ATDATTENDANCEDATA.attendancetype when '96d57412-3483-462c-bb63-d7536be20778' then ATDATTENDANCEDATA.resulttime else 0 END)/60 AS 正常考勤,
sum(case ATDATTENDANCEDATA.attendancetype when 'b931cdd3-c9b7-459f-8d56-7634a2353ad0' then ATDATTENDANCEDATA.resulttime else 0 END)/420 AS '待产假',
sum(case ATDATTENDANCEDATA.attendancetype when '16' then ATDATTENDANCEDATA.resulttime else 0 END)/420 AS '流产假',
sum(case ATDATTENDANCEDATA.attendancetype when '530867a3-b935-4939-8854-0e949111d88d' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '护理假',
sum(case ATDATTENDANCEDATA.attendancetype when '19' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '事假',
sum(case ATDATTENDANCEDATA.attendancetype when '18' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '病假',
sum(case ATDATTENDANCEDATA.attendancetype when '13' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '婚假',
sum(case ATDATTENDANCEDATA.attendancetype when '14' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '产假',
sum(case ATDATTENDANCEDATA.attendancetype when '15' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '丧假',
sum(case ATDATTENDANCEDATA.attendancetype when '17' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '工伤假',
sum(case ATDATTENDANCEDATA.attendancetype when '2e42e61f-8f1a-4a19-8b12-6df5fecc2c7f' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '哺乳假',
sum(case ATDATTENDANCEDATA.attendancetype when '10' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '迟到',
sum(case ATDATTENDANCEDATA.attendancetype when '11' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '早退',
sum(case ATDATTENDANCEDATA.attendancetype when '12' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '旷工',
sum(case ATDATTENDANCEDATA.attendancetype when 'AtdNocardReasonBlank' then ATDATTENDANCEDATA.resulttime else 0 END )AS '未刷卡次数'
FROM dbo.ATDATTENDANCEDATA
WHERE (ATDATTENDANCEDATA.workdate>='{?开始时间}'
AND ATDATTENDANCEDATA.workdate<='{?结束时间}')
group by ATDATTENDANCEDATA.personid ) a on p.personid=a.personid
join ORGSTDSTRUCT o on o.unitid=p.branchid order by o.unitcode
('{?开始时间}','{?结束时间}',是两个字符型参数,实际上应该是时间参数,但是因为'ATDATTENDANCEDATA.workdate 这个字段是字符型,所以,就定义了参数为字符型。报表参数定义截图: 展开
sql语句为:
SELECT o.unitid,o.unitcode as 部门代码,o.unitname as 部门,p.employeeid as 工号,p.truename as 姓名,正常考勤,迟到,早退,旷工,事假,病假,
婚假,丧假,产假,哺乳假,工伤假,流产假,护理假,未刷卡次数 FROM psnaccount p join (
SELECT ATDATTENDANCEDATA.personid,
sum(case ATDATTENDANCEDATA.attendancetype when '96d57412-3483-462c-bb63-d7536be20778' then ATDATTENDANCEDATA.resulttime else 0 END)/60 AS 正常考勤,
sum(case ATDATTENDANCEDATA.attendancetype when 'b931cdd3-c9b7-459f-8d56-7634a2353ad0' then ATDATTENDANCEDATA.resulttime else 0 END)/420 AS '待产假',
sum(case ATDATTENDANCEDATA.attendancetype when '16' then ATDATTENDANCEDATA.resulttime else 0 END)/420 AS '流产假',
sum(case ATDATTENDANCEDATA.attendancetype when '530867a3-b935-4939-8854-0e949111d88d' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '护理假',
sum(case ATDATTENDANCEDATA.attendancetype when '19' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '事假',
sum(case ATDATTENDANCEDATA.attendancetype when '18' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '病假',
sum(case ATDATTENDANCEDATA.attendancetype when '13' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '婚假',
sum(case ATDATTENDANCEDATA.attendancetype when '14' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '产假',
sum(case ATDATTENDANCEDATA.attendancetype when '15' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '丧假',
sum(case ATDATTENDANCEDATA.attendancetype when '17' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '工伤假',
sum(case ATDATTENDANCEDATA.attendancetype when '2e42e61f-8f1a-4a19-8b12-6df5fecc2c7f' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '哺乳假',
sum(case ATDATTENDANCEDATA.attendancetype when '10' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '迟到',
sum(case ATDATTENDANCEDATA.attendancetype when '11' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '早退',
sum(case ATDATTENDANCEDATA.attendancetype when '12' then ATDATTENDANCEDATA.resulttime else 0 END )/420 AS '旷工',
sum(case ATDATTENDANCEDATA.attendancetype when 'AtdNocardReasonBlank' then ATDATTENDANCEDATA.resulttime else 0 END )AS '未刷卡次数'
FROM dbo.ATDATTENDANCEDATA
WHERE (ATDATTENDANCEDATA.workdate>='{?开始时间}'
AND ATDATTENDANCEDATA.workdate<='{?结束时间}')
group by ATDATTENDANCEDATA.personid ) a on p.personid=a.personid
join ORGSTDSTRUCT o on o.unitid=p.branchid order by o.unitcode
('{?开始时间}','{?结束时间}',是两个字符型参数,实际上应该是时间参数,但是因为'ATDATTENDANCEDATA.workdate 这个字段是字符型,所以,就定义了参数为字符型。报表参数定义截图: 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询