# Aged Accounts Receivable

**URL:** <https://www.dynamicsuser.net/t/aged-accounts-receivable/9686>\
**Category:** Developers Forum\
**Created:** [February 14, 2005, 9:03am UTC](https://www.dynamicsuser.net/t/aged-accounts-receivable/9686 "2005-02-14T09:03:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebrunton](https://avatars.discourse-cdn.com/v4/letter/e/7feea3/32.png) [@ebrunton](https://www.dynamicsuser.net/u/ebrunton)\
**Post date:** [February 14, 2005, 9:03am UTC](https://www.dynamicsuser.net/t/aged-accounts-receivable/9686/1 "2005-02-14T09:03:33Z")

</div>

When Client running aged accounts receivable with the options shown, the dates on the column heading for November and October are wrong. They are showing 01/10/04 - 30/10/04 and 31/10/04 - 30/11/04 instead of 01/10/04 - 31/10/04 and 01/11/04 - 30/11/04. The calendar is set up OK. Aged as of 31/01/05 Aged by Posting Date Period Length 1M Heading Type Date… They are using v3.7A but seems common to 3.X. Am I missing something obvious. Any suggestions how to correct this.

---

<div class="post-metadata">

**Author:** ![fbrande](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fbrande](https://www.dynamicsuser.net/u/fbrande)\
**Post date:** [February 14, 2005, 3:58pm UTC](https://www.dynamicsuser.net/t/aged-accounts-receivable/9686/2 "2005-02-14T15:58:08Z")

</div>

In the US version of the Aged Accts Rcvbl report (#10040), we have global variables ‘PeriodEndingDate’ as an array[5] of Date, and a ‘PeriodCalculation’ as Code[10]. PeriodEndingDate[1] gets the value entered by the user in the RequestOptionsForm, as does the PeriodCalculation. The other PeriodEndingDates are essentially calculated as follows:

* * *

`FOR j := 2 TO 4 DO PeriodEndingDate[j] := CALCDATE('-('+PeriodCalculation+')', PeriodEndingDate[j-1]);`

* * *

If you always enter a month-end date on the RequestOptionsForm, and you want the other dates to be the respective month-end dates for the 4 previous months no matter if the ‘current’ month-end day is 28, 29, 30 or 31, then I think that the PeriodCalculation you are looking for is ‘CM-1D’ (presuming, of course, your Aged Receivables report calculates the dates in the same manner as the US version).
