Monday, 16 July 2012

how Query a Database in Oracle Report


select     i.vendor_name, i.vendor_site_code,  i.vendor_number,   i.invoice_type,   i.invoice_date,
       i.invoice_num,      i.invoice_currency_code,   i.invoice_amount,
       nvl(i.amount_paid,0)+ nvl(i.amount_withheld,0) paid_amount,
       nvl(i.invoice_amount,0)-(nvl(i.amount_paid,0)+ nvl(i.amount_withheld,0)) balance,
      --  sum(p.AMOUNT)+sum(nvl(i.amount_withheld,0))+nvl(i.prepaid_amount,0) paid_amount,
 -- nvl(i.invoice_amount,0) -nvl(sum(p.AMOUNT)+sum(nvl(i.amount_withheld,0))+nvl(i.prepaid_amount,0),0) balance,
       --sum(P.AMOUNT) check_amount,
       i.prepaid_amount,
       I.amount_withheld,
       i.gl_date,
       --c.exchange_date payment_rate_date,
       i.description,
       i.doc_sequence_value vno
from
     ap_invoices_v i
where
   i.gl_date between :From_Date and :To_date
and  to_number(i.vendor_number) between nvl(:Vendor_From,i.vendor_number) and nvl(:Vendor_To,i.vendor_number)

No comments:

Post a Comment