SELECT tr.tax_name,tr.tax_rate,tr.comments,d.line_type_lookup_code,-1*sum(d.amount),d.awt_tax_rate_id FROM
Ap_Invoices_All v,
AP_INVOICE_DISTRIBUTIONS_ALL d,
AP_AWT_TAX_RATES_ALL tr
where
v.invoice_id=d.invoice_id
and d.awt_tax_rate_id=tr.tax_rate_id
and v.invoice_date between '1-jul-11' and '30-jun-12'
and d.line_type_lookup_code='AWT'
and v.vendor_id=0000.
group by tr.tax_name,tr.tax_rate,tr.comments,d.line_type_lookup_code,d.awt_tax_rate_id
No comments:
Post a Comment