我已經創建了一個使用查詢哪個UNION兩個表的Crystal報表。第二個表沒有與第一個表相同的行數,因此我爲這些字段傳遞了空值。該報告顯示正確的數據,但是當我運行它時,它會要求我在輸入參數窗口中輸入這些空字段的值。下面是我得到的代碼和圖像。任何想法如何解決這個問題。 (顯示的查詢是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}
你是什麼意思取代舊名稱「它要求我爲這些空字段中輸入值」?它應該要求你爲'{?fDate}'和'{?toDate}'提供值,但是這些空值與參數無關。 – Ryan 2015-04-01 23:09:06