I am trying to get the sum but i am only getting the value of current paid amount when i order it by date desc order
select Top 1 TMN.Invoiceno,TMN.BillDate,PIM.CurrentPaidAmount,PIM.InvoiceAmount,CM.ClientName,PIM.PaymentDate,PIM.OutstandingAmount,
sum(PIM.CurrentPaidAmount) as TotalPaid from TransactionMasterNew TMN
inner join PaymentInfo PIM
on
TMN.Invoiceno = PIM.InvoiceNo
inner join
ClientMaster CM on
CM.ClientId = TMN.ClientId
where
TMN.Invoiceno = 'AC/012' and PIM.OutstandingAmount > 0.00
group by TMN.Invoiceno,CM.ClientName,TMN.BillDate,PIM.CurrentPaidAmount,PIM.InvoiceAmount,PIM.PaymentDate,PIM.OutstandingAmount
order by PIM.PaymentDate Desc
Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved