SELECT i.CustomerID, i.InvoiceDate, i.InvoiceID, i.Particulars, i.Value, i.TaxAmount, i.TotalAmount, col.ReceivedAmount,(i.TotalAmount-col.ReceivedAmount) as 'Balance Amount' FROM (select invoiceid, SUM(receivedamount) as 'ReceivedAmount' from tbCollections group by invoiceid) col JOIN tbInvoice i ON i.InvoiceID=col.InvoiceID
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)