Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank space if Number = 0 3

Status
Not open for further replies.

CRilliterate

Technical User
Dec 7, 2005
467
US
Both of my fields are Number datatype.
Formula is If({field1})=0 then {field2} else ""
I want to see blank if else but formula asks for Number in place of "". How do I display blank if else? Thanks

________________________________________
I am using Windows XP, Crystal Reports 9.0 with SQL Server
 

If {field1} = 0 then
totext({field2},0,"") else ""

-LB
 
I should have known ... LOL THANKS, lbass

________________________________________
I am using Windows XP, Crystal Reports 9.0 with SQL Server
 
OK, now I need to SUM both of these values in both formulas

If {field1} = 0 then
totext({field2},0,"") else ""

and


If {field1} <> 0 then
totext({field2},0,"") else ""

and all it's available for me is Count and MAX.

Thanks

________________________________________
I am using Windows XP, Crystal Reports 9.0 with SQL Server
 
You can select the formatting of the origginal field of suppress if zero by right clicking the field and selecting format field->Number, I think that it's in the Number tab, no need to use a formula here.

-k
 
The reason you can't sum them is because the result of the formula is a string.
Since you need to sum them, I would recommend changing the formulas to return numbers, then suppress the formulas when they meet your condition like this:

//@Formula1
If {field1} = 0
then {field2}
else 0

//@Formula2
If {field1} <> 0
then {field2}
else 0

You will now be able to insert a summary on these formulas.
To suppress the zero values, right click the formula and choose Format Field.
Click on the Number tab and then on the Customize button.
Set the property "Suppress if Zero".

~Brian
 
synapsevampire and bdreed35 - I used your both solutions and it worked and THANKS

________________________________________
I am using Windows XP, Crystal Reports 9.0 with SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top