Query for Payable Invoice_Number aganist for Customer Payment

Posted by Naraayanan under Sql Server on 12/16/2012 | Points: 10 | Views : 617 | Status : [Member] | Replies : 2
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/



Responses

Posted by: Pavanandey on: 12/20/2012 [Member] Bronze | Points: 25

Up
0
Down
are the tblinvoiceHeader.InvoiceNo and tblCustPaymentHeader.PaymentNo pointing data.



Thanks
Pavan Kumar
Mark Answer if this fits the need

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 12/20/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Invoice No and Payment No are different.The only key field is Customer Code.

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response