Year to-date-1 calculation

I’ve made a new report, based upon the Customer table. Code is similar to the code used in Form 151 Customer Statistics. Everything’s running fine, except for one thing: I added a field ‘Year to-date-1’ in my report. The code I use to calculate the datefilter for this field is DateFilterCalc.CreateAccountingPeriodFilter(CustDateFilter[2],CustDateName[2],CurrentDate,-1); But this results, obvious, in the the Amounts of the previous month. Is there a funtion - instead of the CreateAccountingPeriodFilter - which can calculate the Year to-date-1 amounts? I know there is CreateAccountingDateFilter, but how to use it?

Hey Navision professionals! Doesn’t anyone has the solution to my question? I thought it was very easy (for a developer, not for a humble end user [:D]). Any ideas?

I’m afraid you’ll have to create the filter yourself - something like this will give you an idea: CurrentDate := WORKDATE; DateFilterCalc.CreateFiscalYearFilter(MyFilter, MyName, CurrentDate, 0); Customer.SETFILTER("Date Filter", MyFilter); MyFilter := FORMAT(Customer.GETRANGEMIN("Date Filter")) + '..' + FORMAT(CurrentDate - 1); Use this filter (FiscalYearStart…Yesterday) the same way the other (4) filters are used.