Solved

Aging Report

Posted on 1998-08-29
5
477 Views
Last Modified: 2006-11-17
How do I create an aging report in V8?
0
Comment
Question by:rtstannard
  • 3
5 Comments
 
LVL 1

Expert Comment

by:rene_moeller
ID: 1960652
Could you be a bit more specific?
0
 
LVL 4

Accepted Solution

by:
tomook earned 100 total points
ID: 1960653
The general technique is to add a calculated field to a query which determines the "bucket" for each record, then run GROUP BY on that field. To make this simple, you can use two queries, one to calculate the bucket and a second to group.

For example, given the tables and fields:
Customers
   CustID
   CustName
Invoices
   InvID
   CustID
   AmountDue
   Age

Make Query1:
SELECT InvID, CustID, AmountDue, Age,
IIF(Age <= 30, "Current", IIF((Age > 30) And (Age <= 60) , "30-60", "Over 60") As AgingBucket
FROM Invoices;

And Query2:
SELECT CustID, Sum(AmountDue) As BucketTotal, AgingBucket
FROM Query1
GROUP BY CustID, AgingBucket;

0
 
LVL 4

Expert Comment

by:tomook
ID: 1960654
I should note that you can structure things a little differently, which helps you print standard invoices or statements.

Query1:
SELECT InvID, CustID, AmountDue,
  IIf(Age<=30, AmountDue, 0.0) As BucketCurrent,
  IIf((Age>30) And (Age<=60), AmountDue, 0.0) As Bucket30,
  IIf((Age>60) And (Age<=90), AmountDue, 0.0) As Bucket60,
  IIf(Age>90, AmountDue, 0.0) As BucketOver90
FROM Invoices;

Query2:
SELECT CustID,
  Sum(BucketCurrent) As BucketCurrentTotal,
  Sum(Bucket30) As Bucket30Total,
  Sum(Bucket60) As Bucket60Total,
  Sum(BucketOver90) As BucketOver90Total
FROM Query1
GROUP BY CustID;

Query2 will show you one record per customer, which makes certain reports easier to write.
0
 

Author Comment

by:rtstannard
ID: 1960655
tomook:  Thanks for a full, understandable, and syntactically correct answer.  Good work!


0
 
LVL 4

Expert Comment

by:tomook
ID: 1960656
I am glad there were no syntax errors as I just typed it in cold. Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now