Dear All, The following tables are using in my Project.
1)tblinvoiceHeader 2)tblCustPaymentHeader
Table Structure of tblinvoiceHeader: InvoiceNo InvoiceDate CustomerCode TotalAmount Table Structure of tblCustPaymentHeader: PaymentNo PaymentDate CustomerCode TotalAmount
Data: InvoiceNo InvoiceDate Customer_Code TotalAmount 001 10/10/2012 CUST01 50000 002 11/10/2012 CUST01 60000 003 12/10/2012 CUST02 50000 004 13/10/2012 CUST02 60000
PaymentNo PaymentDate Customer_Code TotalAmount 001 12/10/2012 Cust01 90000 001 15/10/2012 Cust02 45000
In this Example data: Cust01 : Invoice 001 -- Paid. Cust01 : Invoice 002 -- Due. Cust02 : Invoice 003 -- Due. Cust02 : Invoice 004 -- Due.
Result like this: Cust01 : Invoice 002 -- 20000. Cust02 : Invoice 003 -- 5000 Cust02 : Invoice 004 -- 60000.
So How can I do this? Please give me query for this Scenario.
Thanks in Advanced
Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/