SELECT
to_number(trim(substr(v.invoice_num,19,6)),'999999'),
sum(v.invoice_amount)
FROM
Ap_Invoices_All v
WHERE
v.invoice_date between '1-jul-2009' and '30-Jun-2010'
and v.vendor_id=1
and v.invoice_type_lookup_code='AWT'
group by to_number(trim(substr(v.invoice_num,19,6)),'999999')
having to_number(trim(substr(v.invoice_num,19,6)),'999999') in ('000000','000000','000000','000000','000000')
No comments:
Post a Comment