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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to display spaces instead of zero

Status
Not open for further replies.

byteias

Programmer
Apr 17, 2007
68
US
Hi,
The idea is not to display if the value = 0.
This is what I have tried:
1) If {TOT_VAR4}=0 then " "
else "/"&totext({TOT_VAR4},"#####",0)
It will display "/- 12" and I need to display "/-12"
2) I created a formula:
a: var4=
If {TOT_VAR4}=0 then " "
else "/"
I used a text object where I place my var4 with tot_var4 on it.
tot_var4 properties is to suppress if it's zero and not thousands separators.
It will display the following:
non zero: "/-12" but if it has a value of zero then displays a zero ("0").
Any ideas of how to fix 1 and/or 2 problems?
Thanks for your help.
Ivan.


 
Try:

If isnull({TOT_VAR4})
or
{TOT_VAR4} = 0 then
""
else
"/" & totext({TOT_VAR4},"",0)

-k
 
Just right clicking the field, select format field, common tab, and check the 'suppress if zero' checkbox.

No formula required.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Thanks for your answer for my problem.
I found another solution, and it works.
If {TOT_VAR4}=0 then " "
else "/"&replace(totext(TOT_VAR4}),',','')
ivan.
 
My formula does the same thing without having to use the replace function, you should test solutions offered.

If {TOT_VAR4} = 0 then
""
else
"/" & totext({TOT_VAR4}),0,"")

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top