Query to check the status of the Periods

Query to check the status of the Periods, www.askhareesh.com

select a.period_name,
       a.period_num,
       a.gl_status,
       b.po_status,
       c.ap_status
from
   (select period_name, period_num, 
    decode(closing_status,'O','Open',
                          'C','Closed',
                          'F','Future',
                          'N','Never',
           closing_status) gl_status
    from gl_period_statuses
    where application_id = 101
    and start_date >= '01-JAN-98'
    and end_date < '01-JAN-99'
    and set_of_books_id = &&set_of_books_id) a,
   (select period_name, 
    decode(closing_status,'O','Open',
                          'C','Closed',
                          'F','Future',
                          'N','Never',
           closing_status) po_status
    from gl_period_statuses
    where application_id = 201
    and start_date >= '01-JAN-98'
    and end_date < '01-JAN-99'
    and set_of_books_id = &&set_of_books_id) b,
   (select period_name,
    decode(closing_status,'O','Open',
                          'C','Closed',
                          'F','Future',
                          'N','Never',
           closing_status) ap_status
    from gl_period_statuses
    where application_id = 200
    and start_date >= '01-JAN-98'
    and end_date < '01-JAN-99'
    and set_of_books_id = &&set_of_books_id) c
where a.period_name = b.period_name
and   a.period_name = c.period_name
order by a.period_num;

Navigation to setup the periods


*/