Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Converting a formula in Oracle to Crystal Post Reply Post New Topic
Author Message
rkohs
Newbie
Newbie


Joined: 28 Nov 2012
Online Status: Offline
Posts: 8
Quote rkohs Replybullet Topic: Converting a formula in Oracle to Crystal
     Posted: 07 Dec 2012 at 3:51am
Hi,

I want to take the following function from oracle and add it as a column in crystal.

function CF_adjustmentFormula return Number is
begin
IF :cash_type IN ('Adjustment', 'Endorsement Adjustment', 'Credit Balance Adjustment') THEN
     RETURN :amount_applied_to_fees;
ELSE
     RETURN NULL;
END IF;
end;

How would I do this?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Dec 2012 at 4:54am

If your report just links tables together, add a SQL Expression to the report that just calls this function.

 
If your report is based on a command, do something like the following:
 
If {MyTable.CASH_TYPE} in ['Adjustment','Endorsement Adjustment','Credit Balance Adjustment'] then
  {MyTable.AMOUNT_APPLIED_TO_FEES}
 
You don't need an "Else" statement because this will autmatically return null when the If condition is not met.
 
-Dell
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