Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: IF THEN ELSE formula problem Post Reply Post New Topic
Author Message
Krazy Kasper
Newbie
Newbie
Avatar

Joined: 11 Jul 2007
Location: United States
Online Status: Offline
Posts: 23
Quote Krazy Kasper Replybullet Topic: IF THEN ELSE formula problem
     Posted: 12 Feb 2009 at 8:29am

I have a formula in my Crystal Report as follows.

It works fine except it doesn't identify records when Sum ({@ExcessUsageAsOfDecember31},{OptimizeIt.LeaseMasterContractId}) is NULL. I tried inserting IS NULL in several places but keep getting syntax errors. I appreciate it anyone can help me finish off this formula.

IF {OptimizeIt.ContractStartDate} in DateTime (2008, 04, 16, 00, 00, 00) to DateTime (2008, 12, 31, 00, 00, 00)
AND Sum ({@ExcessUsageAsOfDecember31}, {OptimizeIt.LeaseMasterContractId}) <=7600
AND Sum ({@ExcessUsageAsOfApril15}, {OptimizeIt.LeaseMasterContractId}) <=7600
THEN "1st Audit - Letter B"

ELSE "TBD"

 

Krazy Kasper
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 13 Feb 2009 at 12:14pm

The syntax for checking for nulls is IsNull({field}).  So, I would try something like this:

IF {OptimizeIt.ContractStartDate} in DateTime (2008, 04, 16, 00, 00, 00) to DateTime (2008, 12, 31, 00, 00, 00) then
if IsNull({@ExcessUsageAsOfDecember31}) or IsNull({@ExcessUsageAsOfApril15}) then "TBD"
else if Sum ({@ExcessUsageAsOfDecember31}, {OptimizeIt.LeaseMasterContractId}) <=7600
AND Sum ({@ExcessUsageAsOfApril15}, {OptimizeIt.LeaseMasterContractId}) <=7600
THEN "1st Audit - Letter B"
ELSE "TBD"

-Dell
IP IP Logged
Krazy Kasper
Newbie
Newbie
Avatar

Joined: 11 Jul 2007
Location: United States
Online Status: Offline
Posts: 23
Quote Krazy Kasper Replybullet Posted: 23 Feb 2009 at 5:30am
Thanks I'll give it a shot.
Sorry I didn't reply sooner - been on vacation in Florida.
Krazy Kasper
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