Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Account Aging Report - how do I do mathematics?
Message
From
05/10/1999 13:29:10
Kenneth Downs
Secure Data Software, Inc.
New York, United States
 
 
To
28/09/1999 18:17:29
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00270271
Message ID:
00272802
Views:
22
Peter,

I think you are making this too complicated. It looks light it can be done much more simply if the following assumptions hold true:
1. 90 day period is actually 60+, meaning up to and after ninety. If not, you need an A90gr variable, for greater than ninety days
2. There is no detail available, and you are dealing with totals per period only.

Therefore, the following code gives you a cursor to feed to the report:
SELE CustomerCode,;
     C30 - P30 AS A30,;
     c60 - p60 AS A60,;
     C90 - P90 as A90,;
     p30 + p60 + p90 as "PT";
  FROM MySummedResults;
  INTO CURSOR ReadyForResult;
  ORDER BY CustomerCode
>I need to add an account aging set of columns to an existing detail report. I believe I have the formulas but am not sure how to get the information into the cursor (or from the cursor) that is used to generate the report...
>
>Here are the formulas - this assumes payments pay off oldest debt
>
>KEY: Ax = Aging total due
> Cx = Charges for that period
> Px = Payments for that period
> PT = Total of payments for all periods
>
>90+ If PT > C90 then A90=0, PT=PT-C90 else A90=C90-PT, PT=0
>60 If PT > C60 then A60=0, PT=PT-C60 else A60=C60-PT, PT=0
>30 If PT > C30 then A30=0, PT=PT-C30 else A30=C30-PT, PT=0
>Cur A30=C0-PT
>
>I use SUM in the SELECT to get the Cx & Px totals. The problem I am having is that I am not sure how to handle the double "math" that is needed for each side of the IF so that I get the right amounts as I work through all the formulas.
>
>Suggestions?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform