Solved

Crystal Formula

Posted on 2013-01-16
2
441 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports total formula with groups? 4 64
Syntax error with existing report; works fine in new report. 2 29
Analyze Shared Variable? 7 28
Crystal Reports - Logos 2 20
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 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