ood.organization_code "Organization Code" , ood.organization_name "Organization Name" , glcc.segment1 "Company_Code", oap.period_name "Period Name" , oap.period_start_date "Start Date" , oap.period_close_date "Closed Date" , oap.schedule_close_date "Scheduled Close" -- DECODE(oap.open_flag, 'P','P - Period Close is processing' , -- 'N','N - Period Close process is completed' , -- 'Y','Y - Period is open if Closed Date is NULL' ,'Unknown') "Period Status" FROM apps.org_acct_periods oap , apps.org_organization_definitions ood, apps.mtl_parameters mp, apps.gl_code_combinations_kfv GLCC WHERE oap.organization_id = ood.organization_id and mp.organization_id = ood.organization_id and mp.material_account = glcc.code_combination_id AND (TRUNC(SYSDATE) -- Comment line if a a date other than SYSDATE is being tested. --AND ('01-DEC-2020' -- Uncomment line if a date other than SYSDATE is being tested. BETWEEN TRUNC(oap.period_start_date) AND TRUNC (oap.schedule_close_date)) and oap.open_flag = 'Y' ORDER BY ood.organization_id, oap.period_start_date;