You are on page 1of 1

select DISTINCT si.

segment1,
si.description,
trx.trx_number,
trx.trx_date,
trx.ct_reference,
trx4.sales_order,
trx4.interface_line_attribute6,
trx4.interface_line_attribute11,
trx4.quantity_credited,
trx4.quantity_invoiced
from ra_customer_trx_all trx,
ra_customer_trx_all trx3,
ra_customer_trx_lines_all trx4,
inv.mtl_system_items_b si
where trx.customer_trx_id = trx3.customer_trx_id
and trx.trx_date between '01-JAN-20' and '30-JAN-2020'
AND trx.customer_trx_id = trx4.customer_trx_id
and si.inventory_item_id = trx4.inventory_item_id
--and LTRIM(trx.ct_reference,'INV#') != trx3.trx_number
and trx.ct_reference LIKE 'INV#%'
and trx4.inventory_item_id is not null
--and trx4.description NOT IN ('SHRINKAGE','AR ADJUSTMENTS','REPRESENTATION
EXPENSE')

You might also like