Date Filter on Customer Statistics

Hi all… 3.7a c/side here… Quick question regarding a date filter… The customer statistic card has an overdue balance field that looks like it calcs anything over 30D. Going into the code I notice that the filter for the calc is as follows: SETRANGE(“Date Filter”,0D,CurrentDate); CALCFIELDS( Balance,“Balance (LCY)”,“Balance Due”,“Balance Due (LCY)”, What I want to do is calc anything over 60D…is this possible? Would something like this work? SETRANGE(“Date Filter”,CALCDATE(’-CD-12M’,WORKDATE),CALCDATE(’-CD-90D’,WORKDATE)); I know that code may seem like I am on crack…but I need help :slight_smile: Thanks, JP

quote:

The customer statistic card has an overdue balance field that looks like it calcs anything over 30D.

On My Version, and I assume the others…the Overdue Amount field is using the Due Date to calculate it’s amount. The due date based on the Payment terms of the customer. It’s not just a flat anything 30DAYS+ is in that field. If you manually change the due date on an Customer Ledger Entry (Due then Not Due) you will see your Overdue Amount statistic change.

Ok…I see so it is pulling vs the Customer Payment Terms. But is there a way that I can create a field or just modify the code to display balance due over 60D? I notice that in the Customer Table "Balance Due (LCY) and “Balance” are the exact same amount…so something on this form is telling it to filter based on date range. Thanks, JP

You should be able to get your values from the field “Net Change” on the customer card, which uses the “Date Filter” in calculating the sum field, where “Balance” does not take the “Date Filter” into account. Then set your date filter as follows: SETRANGE(“Date Filter”,0D,CALCDATE(‘CM-3M’,WORKDATE)); Please note that I have not tested the above SETRANGE snippet, but I have used Net Change. Regards, gus

Thanks for the help guys… I had to end up pulling my totals from the Cust. Ledger Entry table…but all works well now. Again thanks for the suggestions. JP