Greetings:
I work at a medical facility. I have established 2 parameters. One for start date, the other for end date. This is being used on quarterly reports. I am trying to insert this is an SQL query. Here is the logic:
(Select sum(A."visits") from SMSDSS.c_cmb_vst_v_20050303 A
where A."orgz_short_name" = c_cmb_vst_v_20050303."orgz_short_name" and
A."drg_no" = '127' and
A. "ind_readm_30_samedrg"= 1 and
A. "vst_type_cd"= 'i' and
A. "dsch_date" = '{?Start Date}' and
A."dsch_date"= '{?End Date}')
Basically, what is says is sum (visits) from the visits table. I am qualifying on DRG (diagnosis related group) 127 and if the patient was readmitted for the same drg within 30 days and if the patient had a type code of i which is inpatient and the discharge date (Start date) is 01/01/2004 and the discharge date (End date) is 03/31/2004. However, with the insert of the parameter in my SQL I get an error message. (Syntax error. No rowset was returned for this query, procedure or table.) I am on Crystal 8.5.
Thank you.
I work at a medical facility. I have established 2 parameters. One for start date, the other for end date. This is being used on quarterly reports. I am trying to insert this is an SQL query. Here is the logic:
(Select sum(A."visits") from SMSDSS.c_cmb_vst_v_20050303 A
where A."orgz_short_name" = c_cmb_vst_v_20050303."orgz_short_name" and
A."drg_no" = '127' and
A. "ind_readm_30_samedrg"= 1 and
A. "vst_type_cd"= 'i' and
A. "dsch_date" = '{?Start Date}' and
A."dsch_date"= '{?End Date}')
Basically, what is says is sum (visits) from the visits table. I am qualifying on DRG (diagnosis related group) 127 and if the patient was readmitted for the same drg within 30 days and if the patient had a type code of i which is inpatient and the discharge date (Start date) is 01/01/2004 and the discharge date (End date) is 03/31/2004. However, with the insert of the parameter in my SQL I get an error message. (Syntax error. No rowset was returned for this query, procedure or table.) I am on Crystal 8.5.
Thank you.