Hi, I am building a report for my client. They want to see the AR aging based on invoice date, not due date. For example, the current column shows invoices created during the past 30 days; 1-31 Days column shows invoices created during the past 31-60 days. I copied the standard AR Aging report and edited formulas on it. I used Iif(CDec( DateDiff( 'd', ,ARInvoice.DocDate], Today()) )<61 AND CDec( DateDiff( 'd', ,ARInvoice.DocDate], Today()) )>30,iif(fARInvoice.DocType]='CRM',-1*1ARInvoice.DocBal],]ARInvoice.DocBal]),0). It works for details. However, when it comes to totals, I used =sum(Iif(CDec( DateDiff( 'd', ,ARInvoice.DocDate], Today()) )<61 AND CDec( DateDiff( 'd', ,ARInvoice.DocDate], Today()) )>30,iif(fARInvoice.DocType]='CRM',-1*1ARInvoice.DocBal],]ARInvoice.DocBal]),0)). This sum function only works for invoices don’t have credit memos/partial payments applied. When there is document applied to the invoice, the total doubled (for1 document applied invoice) or trippled (for 2 documents applied invoice). Can anyone help me with the sum function?