SQL for AR Credit Memos to GL
Hello,
I am trying to write a query in R11 that links the AR Credit Memos to the GL Journal Entry. In most cases I can get it to tie for each journal entry header id. However, there are a few that are off and I can't figure out why. Below is the sql I am using...any help is greatly appreciated!
select distinct gir.je_header_id, rctlgda.acctd_amount
from gl_import_references gir
, gl_je_headers gjh
, ra_cust_trx_line_gl_dist_all rctlgda
, gl_code_combinations gcc
, gl_je_lines gjl
where gir.JE_HEADER_ID=gjh.JE_HEADER_ID