Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: If Statement if Command is valid Post Reply Post New Topic
Author Message
sequenzia
Newbie
Newbie


Joined: 24 Jul 2012
Online Status: Offline
Posts: 1
Quote sequenzia Replybullet Topic: If Statement if Command is valid
     Posted: 24 Jul 2012 at 7:32am
I am using Crystal Reports 2008.

I am having issues getting the Syntax correct for a formula.

The report is grouped by customers.I have 2 commands. The first one will always have a value but the second one has a value for some of the customers but not all.

What I need to do is write a formula that will use just a value of the first command if the second command does not have a value for that customer. If the second command does have a value then it should take the sum of command one and two.

I have tried it like this:

IF ISNULL({Command_2.fin_bal_60})

THEN

{Command_1.inv_bal_60}

ELSE

{Command_1.inv_bal_60} + {Command_2.fin_bal_60}

That is not working because when I put it into the report it only shows the records that have a value in command_2.

I am trying to figure out how to write this so even if command_2 does not return a value it just uses command_1.

Any help on this would be great.

Thanks in advance.


IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 24 Jul 2012 at 8:58am
I am wondering if you should have Exception for Nulls or Default Values for Nulls selected in the formula.  I would think it would be Default Values for Nulls.

I hope this helps.
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