Thursday 26 December 2013

GL Journal Headers

SELECT DISTINCT gjct.user_je_category_name category
       , gjst.user_je_source_name source
       , gjb.name batch_name
       , gjh.period_name period
       , gjh.name journal_name
       , gjh.external_reference journal_ref
       , gjh.date_created
       , gjh.description
       , gjh.running_total_dr ttl
       , gjh.creation_date
       , fu.description created_by
    FROM gl.gl_je_headers gjh
       , gl.gl_je_batches gjb
       , gl.gl_je_sources_tl gjst
       , gl.gl_je_categories_tl gjct
       , applsys.fnd_user fu
   WHERE gjh.je_batch_id = gjb.je_batch_id(+)
     AND gjh.je_source = gjst.je_source_name
     AND gjh.je_category = gjct.je_category_name
     AND gjh.created_by = fu.user_id
     AND gjh.creation_date >= '11-FEB-2013'
--     AND gjh.name = '12345ABC'
--     AND fu.user_name = 'BOBBY'
--     AND gjh.name = 'Miscellaneous Transaction GBP'
--     AND gjh.je_header_id = 1234
--     AND gjct.user_je_category_name = 'ABC'
ORDER BY gjh.creation_date DESC;
 
  SELECT gjst.user_je_source_name
       , COUNT (*) ct
       , MAX(gjh.creation_date) latest
    FROM gl.gl_je_headers gjh
       , gl.gl_je_sources_tl gjst
   WHERE gjh.je_source = gjst.je_source_name
GROUP BY gjst.user_je_source_name;

No comments:

Post a Comment