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

Crystal Not Recognizing a Symbol

Status
Not open for further replies.

Rob7

Programmer
Dec 12, 2001
152
US
Hi All,

I am working with a database that will show a dash (-) in a numeric field when the value is zero. I would like to show the zero on my report. I have tried to create a formula field with:

If {TableName.FieldName} = "-" Then
0
Else
{TableName.FieldName}

When I do this I get an error saying that a number a string or a boolean is required. It looks like Crystal is not recognizing the symbol as anything at all. Has anyone else run across this?

Thanks in advance

Rob
 
If a field contains a dash, then it is NOT numeric, try:

If {TableName.FieldName} = "-" Then
0
Else
tonumber({TableName.FieldName})

-k
 
k

I tried that and it highlighted the "-" and indicated that number was required there. I also the tried ToNumber("-") but Crystal didn't like that either.

Rob
 
I figured it out. I was trying to find a complicated answer to an easy problem. All I had to do was change the formatting of the field from Custom to (-1234). and the zero shows up.

Thanks for looking k

Rob
 
I see, you meant the output formatting of a field contained a minus sign...

This has nothing to do with what's in the field, as you originally posted, rather some formatting applied,so the complication was your interpretation.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top