1st Method
SELECT DISTINCT
b.invoice_id,
b.invoice_num,
b.invoice_date,
b.gl_date,
b.invoice_currency_code,
b.invoice_amount,
b.invoice_type_lookup_code,
a.period_name,
a.dist_code_combination_id
FROM ap_invoice_distributions_all a,
ap_invoices_all b
WHERE a.invoice_id = b.invoice_id
AND b.invoice_date BETWEEN '1-AUG-2011' AND '31-AUG-2011'
AND b.org_id = 246
2nd Method
SELECT DISTINCT
b.invoice_id,
b.invoice_num,
b.invoice_date,
b.gl_date,
b.invoice_currency_code,
b.invoice_amount,
b.invoice_type_lookup_code,
a.period_name,
a.dist_code_combination_id
FROM ap_invoice_distributions_all a,
ap_invoices_all b
WHERE a.invoice_id = b.invoice_id
AND b.invoice_date BETWEEN '1-AUG-2011' AND '31-AUG-2011'
AND b.invoice_type_lookup_code='DEBIT'
AND b.org_id = 246
SELECT DISTINCT
b.invoice_id,
b.invoice_num,
b.invoice_date,
b.gl_date,
b.invoice_currency_code,
b.invoice_amount,
b.invoice_type_lookup_code,
a.period_name,
a.dist_code_combination_id
FROM ap_invoice_distributions_all a,
ap_invoices_all b
WHERE a.invoice_id = b.invoice_id
AND b.invoice_date BETWEEN '1-AUG-2011' AND '31-AUG-2011'
AND b.org_id = 246
2nd Method
SELECT DISTINCT
b.invoice_id,
b.invoice_num,
b.invoice_date,
b.gl_date,
b.invoice_currency_code,
b.invoice_amount,
b.invoice_type_lookup_code,
a.period_name,
a.dist_code_combination_id
FROM ap_invoice_distributions_all a,
ap_invoices_all b
WHERE a.invoice_id = b.invoice_id
AND b.invoice_date BETWEEN '1-AUG-2011' AND '31-AUG-2011'
AND b.invoice_type_lookup_code='DEBIT'
AND b.org_id = 246
No comments:
Post a Comment