Solved

Crystal Formula

Posted on 2013-01-16
2
444 Views
Last Modified: 2013-01-16
Hello everybody,
I have the below crystal formula:

if {Billing.CCID}= 'MNGED PER DIEM' or {Billing.CCID}= 'MED A PER DIEM' then

local numbervar billamount := {Billing.BillAmt}
else
if IsNull({Billing.CCID}) then
local numbervar billamount := 0.00;

The formula is displaying the data for medaperdiem or mngedperdiem but the second condition is not getting evaluated.Its not displaying 0.00

Please help.
0
Comment
Question by:Star79
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 43

Accepted Solution

by:
zephyr_hex (Megan) earned 500 total points
ID: 38784332
Crystal requires the evaluation of null FIRST.  


Try this:

local numbervar billamount;  //this declares the local variable
if isnull({Billing.CCID})  then billamount:=0
else if ({Billing.CCID}= 'MNGED PER DIEM' or {Billing.CCID}= 'MED A PER DIEM' ) then
billamount := {Billing.BillAmt};
0
 
LVL 43

Expert Comment

by:zephyr_hex (Megan)
ID: 38784361
you might want to consider what should happen with billamount if {Billing.CCID} is not null, not 'MNGED PER DIEM' and not 'MED A PER DIEM'.  in other words, make sure you don't need a default value for billamount.  you could do one of the following:

local numbervar billamount:=0;  //this declares the local variable and sets default value to zero
if isnull({Billing.CCID})  then billamount:=0
else if ({Billing.CCID}= 'MNGED PER DIEM' or {Billing.CCID}= 'MED A PER DIEM' ) then
billamount := {Billing.BillAmt};

-------------------
or
------------------
local numbervar billamount;  //this declares the local variable
if isnull({Billing.CCID})  then billamount:=0
else if ({Billing.CCID}= 'MNGED PER DIEM' or {Billing.CCID}= 'MED A PER DIEM' ) then
billamount := {Billing.BillAmt}
else billamount:=0;  //if all else fails, set billamount to 0
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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