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

If Else in Crystal 8.5

Status
Not open for further replies.

ef61778

IS-IT--Management
Sep 23, 2003
14
0
0
US
I am working on a If Else where I check if the value is X I show X-Text

Here is what I have

If {VW_GMAC_CCASHFR_CHECK_STATUS.PMTNUM} = 0 then "0-Shared"

This produces an error that a tell me a string is needed.

When I place "" around the 0, the report shows no data. How do I check for a number value and show the corresponding text?
 
Try
If totext({VW_GMAC_CCASHFR_CHECK_STATUS.PMTNUM}) = "0" then "0-Shared"

CR needs to evaluate and return the same type of data.

James
 
try this

If tonumber({VW_GMAC_CCASHFR_CHECK_STATUS.PMTNUM}) = 0 then "0-Shared
 
I have tried both of these but I get the same error message on both "The result of selection formula must be in boolean". Should I change the format of the field to text?
 
I was just replacing your statement (it is incomplete). You still need the else

So you would put....
If tonumber({VW_GMAC_CCASHFR_CHECK_STATUS.PMTNUM}) = 0 then "0-Shared"
Else
"Some other text
 
I think you are creating the formula in the wrong place. Unless you intend to use this for record selection, go to the formula editor to enter your formula.

-LB
 
Try:

Insert->Field->Name it and then place your code in there.

If you're trying to limit the rows returned from the database to those with a zero value, use Report->Edit Selection Formula->Record and try:

{VW_GMAC_CCASHFR_CHECK_STATUS.PMTNUM} = 0

-k
 
Ooops, I may have the exact Insert->Field part wrong in your menu, you're after a Formula.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top