我遇到了JasperReports的一种情况。我有一个报告查询,它获取三个参数,就像这样:
SELECT DISTINCT
mr.int_grp_no,
mr.grp_no,
ISNULL((select cv_lbl from code_value_mcg where cv_type = 'mem grp type' and cv_code = (select grp_type from mem_group_mcg where group_id = mr.grp_no)), '') as grouptype,
isnull((select reg_date_en from mem_group_mcg where group_id = mr.grp_no), '') as reg_date,
isnull((select name from mem_group_mcg where group_id = mr.int_grp_no), '') as intergroup,
isnull((select name from mem_group_mcg where group_id = mr.grp_no), '') as groupname,
(select count(mid) from mem_reg_mcg where gender = 1 and grp_no = mr.grp_no) as totmale,
(select count(mid) from mem_reg_mcg where gender = 2 and grp_no = mr.grp_no) as totfemale,
((select count(mid) from mem_reg_mcg where gender = 1 and grp_no = mr.grp_no)+(select count(mid) from mem_reg_mcg where gender = 2 and grp_no = mr.grp_no))as total
FROM
dbo.mem_reg_mcg as mr
where $P{condition} and mr.reg_date between $P{Reg_date_from} and $P{Reg_date_to}]
在参数条件中,我将传递类似的东西mr.mem_in = 2
,mr.grp_no = 3
但是当我在参数中传递这样的值时,当报告获取参数时,它会将参数生成为'mr.mem_in = 2 and mr.grp_no = 3'
. 引号是此查询中的错误。所以我假设去掉引号。
那么我该怎么做呢?
任何想法都会对我很有帮助。