I am using Crystal 10 on Win XP machine. I pulling data from a Cashe database. I have converted a Crystal 8.5 report to Crystal 10. The report and the formula will work in Crystal 8.5 but the same formula will not run in Crystal 10. When I open the report I immediately get the message that "The saved data will be discarded since one or more of the formulas will not compile." When I ok through that message I am able to enter the three parameters need to run the report. I am then thrown into the formula editor where the first "else" in my statement is highlighted and the message box states "The ) is missing." I check the structure of the nested if several times and cannot see where a ")" is needed. Please find below the nested IF statement. Any suggestions will be appreciated.
whileprintingrecords;
shared numbervar ProdUnitsGrp;
numbervar Mins := Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE});
shared numbervar UnitsGrp;
if {service_code_table.cluster_code} in ['11', '21', '22', '27', '40', '41'] then
(if {@CPT Eligible} = 'Y' then
if {tx_history_all.SERVICE_CODE} in ['P102', 'P108', 'P109', 'P130', 'P131', 'P133' TO 'P139', 'P142', 'P208', 'P209', 'P9805', 'PM108', 'PM109', 'PM208', 'PM209'] then
select Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) case 0 to 19 : Mins := 0
case 20 to 44 : Mins := 30
case 45 to 74 : Mins := 50
default : Mins := 80;
else
if {service_code_table.cluster_code} = '32' then
(if remainder(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}), 15) = 0 then
Mins := Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE})
else
if remainder(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}), 15) < 8 then
Mins := Int(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) / 15) * 15
else
Mins := (Int(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) / 15) + 1) * 15)
else
Mins := Mins
else
if remainder(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}), 15) = 0 then
Mins := Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE})
else
if remainder(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}), 15) < 8 then
Mins := Int(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) / 15) * 15
else
Mins := (Int(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) / 15) + 1) * 15;
ProdUnitsGrp := Mins / 60;
UnitsGrp := UnitsGrp + ProdUnitsGrp;
ProdUnitsGrp
else
ProdUnitsGrp := ProdUnitsGrp;
UnitsGrp := UnitsGrp;
whileprintingrecords;
shared numbervar ProdUnitsGrp;
numbervar Mins := Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE});
shared numbervar UnitsGrp;
if {service_code_table.cluster_code} in ['11', '21', '22', '27', '40', '41'] then
(if {@CPT Eligible} = 'Y' then
if {tx_history_all.SERVICE_CODE} in ['P102', 'P108', 'P109', 'P130', 'P131', 'P133' TO 'P139', 'P142', 'P208', 'P209', 'P9805', 'PM108', 'PM109', 'PM208', 'PM209'] then
select Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) case 0 to 19 : Mins := 0
case 20 to 44 : Mins := 30
case 45 to 74 : Mins := 50
default : Mins := 80;
else
if {service_code_table.cluster_code} = '32' then
(if remainder(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}), 15) = 0 then
Mins := Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE})
else
if remainder(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}), 15) < 8 then
Mins := Int(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) / 15) * 15
else
Mins := (Int(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) / 15) + 1) * 15)
else
Mins := Mins
else
if remainder(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}), 15) = 0 then
Mins := Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE})
else
if remainder(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}), 15) < 8 then
Mins := Int(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) / 15) * 15
else
Mins := (Int(Maximum ({tx_history_all.service_duration}, {tx_history_all.SERVICE_CODE}) / 15) + 1) * 15;
ProdUnitsGrp := Mins / 60;
UnitsGrp := UnitsGrp + ProdUnitsGrp;
ProdUnitsGrp
else
ProdUnitsGrp := ProdUnitsGrp;
UnitsGrp := UnitsGrp;