Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to change report via radio group in Oracle APEX using if statement

User_M4XGBDec 20 2022

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?

Comments
Post Details
Added on Dec 20 2022
3 comments
226 views