我创建了一个Crystal报表,它使用的是一个UNION两个表的查询。第二个表与第一个表的行数不同,因此我为这些字段传递空值。报告显示正确的数据,但是当我运行它时,它要求我在输入参数窗口中输入这些空字段的值。以下是我得到的代码和图像。知道如何解决这个问题。 (显示的查询是UNION下面的查询)
SELECT ncs.staff_id,
substring(service_code, 7) as Service_Value,
substring(replace(replace(service_code,'(',''), ')', ''), 1, 3) as Service_Code,
duration,
service_date,
null as PATID,
scd.name as Staff_Name,
CASE substring(replace(replace(service_code,'(',''), ')', ''), 1, 3)
WHEN '703' then 'NB'
WHEN '704' then 'NB'
WHEN '709' then 'NB'
WHEN '710' then 'NB'
WHEN '900' then 'NB'
WHEN '826' THEN 'NB'
WHEN '827' THEN 'NB'
WHEN '406' THEN 'NB'
WHEN '708' THEN 'NB'
WHEN '564' THEN 'NB'
WHEN '707' THEN 'NB'
WHEN '211' THEN 'NB'
WHEN '399' THEN 'NB'
WHEN '702' THEN 'NB'
WHEN '705' THEN 'NB'
WHEN '723' THEN 'NB'
END AS Charge_Cat,
null as episode_number,
null as patient_name,
start_time as start_time,
cast(dateadd(MINUTE, duration,start_time)as time ) as end_time,
ncs.ID,
null as guarantor_id,
null as guarantor_name,
'I' as Service_Code,
scd.practitioner_category_value,
null as RRG_CODE, --RRG NEED TO CHECK IF IT IS POSIBLE TO CREATE A VALUE BASE ON PROGRAM CODE
null as Join_to_tx_history,
ncs.FACILITY,
null as location_value,
substring(replace(replace(service_program,'(',''), ')', ''), 1, 3) as Program_Code,
substring(service_program, 7)
FROM NON_CLIENT_SPECIFIC_ENTRY ncs
INNER JOIN staff_current_demographics scd ON
scd.FACILITY = ncs.FACILITY AND scd.STAFFID = ncs.STAFF_ID
WHERE service_date BETWEEN {?fDate} AND {?toDate}
答案 0 :(得分:0)
当报告更改为使用查询而不是表时,它会删除子报告链接的所有引用。再次创建它们并更改子报表选择专家中的代码以使用新创建的链接参数修复了问题。
答案 1 :(得分:0)
这个问题的答案是,当进行更改时,子报表链接的引用也会被删除,或者新名称与之前的名称不匹配。所以它要求我输入子报告链接参数的值。
我更新了子报表链接并用新的名称替换旧名称