Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Help with formula Post Reply Post New Topic
Author Message
Davx
Newbie
Newbie


Joined: 06 Sep 2012
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote Davx Replybullet Topic: Help with formula
     Posted: 06 Sep 2012 at 10:46pm
Hi Guys,

I have downloaded the trial of Crystal reports and am trying to see if I can create an aged debtors report from our databases (dbase 5).

I need to create a formula like this;

Databases = customers, sales

From the customers database I have been able to create a simple report listing the acc_ref, acc_name and credit limit which all appear in the customers table.

I have linked the two databases on the field acc_ref as it appears in both tables.

Now the bit I am stuck on, I need to create a field which pulls sales information for each customer, the sum of orders in a date range like this.

sum (if order_date is within the last 30 days)
sum (if order_date is within the last 90 days)
sum (if order_date is within the last 120 days)

I have tried creating a running total for the field Sales.Total_Net and selected evalute to use a formula which was "{SALES.ORD_DATE} = Aged0To30Days"

Which gave no output.

Any advice would be appreciated.

Kind Regards
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 07 Sep 2012 at 2:18am
HI
 
Try the following :
 
In the detail seciton place the following formulas :
 
@30days
if OrderDAte in Aged0To30Days then Amount
else 0
 
@60days
if OrderDAte in Aged31To60Days then Amount
else 0
 
@90day
if OrderDAte in Aged61To90Days then Amount
else 0
 
Now right click on the formula after placing in detail and go in Insert--Summary .. select Grand Total
 
 
 
 
Thanks,
Sastry
IP IP Logged
Davx
Newbie
Newbie


Joined: 06 Sep 2012
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote Davx Replybullet Posted: 07 Sep 2012 at 4:24am
Sasty

Thanks for the reply.

I created a formula field and added it to the details section with this formula in:

if {SALES.ORD_DATE} in Aged0To30Days then {SALES.TOT_NET} else 0

However this shows 0 for all accounts.

Would I need to do anything to the date format? The ord_date column is in this format dd/MM/YY.

Kind Regards

Dave
IP IP Logged
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