Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How to convert 0 to null value? Post Reply Post New Topic
Author Message
mh9876
Newbie
Newbie


Joined: 24 Dec 2017
Location: United States
Online Status: Offline
Posts: 6
Quote mh9876 Replybullet Topic: How to convert 0 to null value?
    Posted: 12 Feb 2018 at 6:41am
I am trying to display the 0 value as null. I don't want to suppress it because I'm using a background color for that entire row and don't want a white space (which appears if I suppress the value 0).

In the field formula I have the following code, but it's not doing any thing and would still display 0.
My field is NUM_DATA_02. @Blank is a formula with '' in it.

If {Command.NUM_DATA_02}=0 OR IsNull({Command.NUM_DATA_02}) Then val({@Blank}) Else {Command.NUM_DATA_02}

I even try the following code to specifically mention which record number, but that's not working either.

If RecordNumber = 7 and {Command.NUM_DATA_02}=0 OR IsNull({Command.NUM_DATA_02}) Then val({@Blank}) Else {Command.NUM_DATA_02}

Any help is greatly appreciated!
IP IP Logged
mh9876
Newbie
Newbie


Joined: 24 Dec 2017
Location: United States
Online Status: Offline
Posts: 6
Quote mh9876 Replybullet Posted: 12 Feb 2018 at 7:36am
I have the following formula in "Display String" under common tab. This works but it changes my numeric field to text and I cannot format it with decimals and percent sign.

IF RecordNumber in [7, 14] Then ToText({@Blank}) Else ToText({@Numeric Data 02})
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.043 seconds.