Quarterly balances of GL Account

My report requests for a year in the request form. I am using an array to hold the dates and another array to hold the balances.

Following are the issues I request for assistance:

-to calculate balances by end of the previous year and by end of each quarter.

-calculate dates based on the specified year.

How do I achieve the above named? Thanks in advance.

You can calculate balances by assiging a date to the date filter on the g/l account and then calling calcfields(balance).

You can assign the correct date (last year or period, etc) by using a the CALCDATE function.

You can read more about it by clicking F5 when looking out code, in the leftmost window scroll down to SYSTEM, in the next window, look for DATE, and in the next window select CALCDATE and hit F1. You can find more detailed examples and explanations on how to use CALCDATE and DATEFORMULAs there.

Thanks. Probably for clarity, why does the code (below) fail to display quartely dates after I have specified the start date (record in Accounting Period table)?

Report - OnPreReport()
IF FiscalYearStartDate=0D THEN
ERROR(‘You must specify the fiscal year start date’);

Day := DATE2DMY(FiscalYearStartDate,1);
Month:=DATE2DMY(FiscalYearStartDate,2);
Year:= DATE2DMY(FiscalYearStartDate,3);

Quarters := 0;

REPEAT
FiscalYearStartDate := DMY2DATE(Day,Month,Year);
QuarterDate[Quarters]:=CALCDATE(‘CD+3M’,FiscalYearStartDate);
Quarters += 1;
UNTIL AccountingPeriod.NEXT = 0;

Kind Regards!