I am trying to dynamically change what a report displays based on what is selected in a radio group.
if :p33_RG = 'Daily' then
select project_name, to_char(date_sys, 'MM/DD/YYYY') as Day,
sum(BATCH.RECORDS_NUMBER) as Count_of_Documents
from BATCH
where date_sys between :P33_START_DATE and :P33_END_DATE
group by project_name, to_char(date_sys, 'MM/DD/YYYY');
else if
:p33_RG = 'Weekly' then
select project_name, to_char(TRUNC(date_sys, 'IW'), 'MM/DD/YYYY') as WEEK,
sum(BATCH.RECORDS_NUMBER) as Count_of_Documents
from BATCH
where date_sys between :P33_START_DATE and :P33_END_DATE
group by project_name, TRUNC(date_sys, 'IW');
end if;
however I am getting multiple errors when I try to run this. Any suggestions on how I can change the script?