Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Crystal Report Post Reply Post New Topic
Author Message
Pat Hines
Newbie
Newbie
Avatar

Joined: 27 Oct 2008
Location: United States
Online Status: Offline
Posts: 2
Quote Pat Hines Replybullet Topic: Crystal Report
    Posted: 27 Oct 2008 at 12:36pm
I have a file of invoices and payments that contain dates.  I want to age the invoice and payment into the same age group so that when printed the balance is shown.  The invoice and payment have different dates but are identified with different codes so I can differentiate which is which but don't know how to handle the outocme.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 27 Oct 2008 at 11:52pm
I would use a formula which evaluates the date and assigns a category to it based upon the age of the item. You can then use this category to either put the data in a separate column or put an identifier next to it. Is this along the lines of what you would like to do? Here is a sample for categorizing the item into an aging period.
Global StringVar Aging;
Select DateDiff("d", CurrentDate, {table.datefield})
Case 1 to 29:
   Aging := "Under 30 days"
Case 31 to 60:
   Aging := "30 to 60 days"
Default:
   Aging := "Over 60 days";
;
If you need to learn about formulas and Crystal syntax, my Encyclopedia book has three chapters that teach you all about it and give you sample code you can use in your own reports. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Pat Hines
Newbie
Newbie
Avatar

Joined: 27 Oct 2008
Location: United States
Online Status: Offline
Posts: 2
Quote Pat Hines Replybullet Posted: 28 Oct 2008 at 9:13am

I think you are on to what I need to do but allow me - I have the data as follows:

Invoice #   Date           Amount       Code

1000       09/01/08          $10.00       I    (Invoice)
1000       10/01/08          $ 9.00        P   (Payment)
 
I want to age the payment using the age of the corresponding invoice and sum amounts for a total balance.  Any ideas?
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.