Limiting to end of last Accounting Period!

Hi, I need help with a report in which I use Sales Invoice Header to select a job number and then lookup all related postings in the G/L Entry to calculate contribution margin. I want to limit the G/L Entry posts until the end of the LAST Accounting Period, regardless of all other filters. For example, if I am running this report on the 6th of Feb. then it should only include the posts made before the 30th of Jan. as the last accounting period ended on 29th of Jan. How do I do that? It is Navision Attain Version W1 3.01.B (DK 3.01.B) I’m working with. Regards, Tariq

Hmm … so your Accounting Periods are not equal to the monthes!? As in your example, the January end on 29th, not on 31st!? Too bad, otherwise it would be easy … you could determine the date like this: CurrentDate := 060206D; PeriodEndDate := CALCDATE(’<-CM>’, CurrentDate) - 1; PeriodEndDate would give 31.01.2006, so you could filter on Entries < PeriodEndDate. So, how have you defined you Accounting Period Starting Date? What you could do to determine this PeriodEndDate, is, to filter on the “Accounting Period” table (T50) like this: CurrentDate := 060206D; AccPeriod.SETFILTER(“Starting Date”, ‘<=%1’ ,CurrentDate); AccPeriod.FIND(’+’); This would give you the “Starting Date” from the current period, thus, subtracting 1 day should be the Ending Date of the previous period: PeriodEndDate := AccPeriod.“Starting Date” - 1; Hope this helps a little …

Thanks Joerg, it works just fine. Yes, our accounting periods are different from the calender months. Regards, Tariq