Solved

Crystal Formula

Posted on 2013-01-16
2
426 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
  • 2
2 Comments
 
LVL 42

Accepted Solution

by:
zephyr_hex earned 500 total points
Comment Utility
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 42

Expert Comment

by:zephyr_hex
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

16 Experts available now in Live!

Get 1:1 Help Now