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

Formula not displaying results

Status
Not open for further replies.

guest101

Programmer
Aug 10, 2004
8
US
I have the following formula but it is not displaying anything. Any ideas?


if {JCCONTM0_DAT.WAREASON2} = "MATEK" or {JCCONTM0_DAT.WAREASON2} = "MATDK" then
if {JMEMBRM0_DAT.AACOUNTY} = "33" then 'R'
else if {JMEMBRM0_DAT.AACOUNTY} = "36" then 'S'
 
Try:

(
(
if {JCCONTM0_DAT.WAREASON2} = "MATEK" or {JCCONTM0_DAT.WAREASON2} = "MATDK" then
(
if {JMEMBRM0_DAT.AACOUNTY} = "33" then 'R'
else if {JMEMBRM0_DAT.AACOUNTY} = "36" then 'S'
)
// might put an else here for testing
)
// might put an else here for testing
)

-k
 
I tried this but it is still not displaying any results.
 
Did you put in else statements to check if there are results at all?

Your post doesn't give much to work on, the above formula should return results if the criteria is found.

Note that a fully qualified post will supply technical information, such as:

Crystal version
Database/connectivity used
Example data
Expected output

You've supplied none of these.

What's in the record selection formula?

Where are you using this formula?

-k
 
Try laying the fields on your report in the detail section to make sure they do, in fact, display as "MATEK", "MATDK", "33", "36", etc. It will also let you see if you have any nulls to handle.

You could also try something like:

if (isnull({JCCONTM0_DAT.WAREASON2}) or
trim({JCCONTM0_DAT.WAREASON2}) = "") then
"No Reason Specified" else
if {JCCONTM0_DAT.WAREASON2} in ["MATEK", "MATDK"] then
(if (isnull({JMEMBRM0_DAT.AACOUNTY}) or
trim({JMEMBRM0_DAT.AACOUNTY}) = "") then
"No Result" else
if {JMEMBRM0_DAT.AACOUNTY} = "33" then 'R' else
if {JMEMBRM0_DAT.AACOUNTY} = "36" then 'S' else
"Other Result") else
"Other Reason"

-LB
 
I pasted your statement into the formula editor and replaced your fields and values such that I knew there would be records and it worked fine. So your phrasing is ok (presuming that {JMEMBRM0_DAT.AACOUNTY} is character data not numeric) - it's something probably very simple like putting the field in the wrong report section or maybe you are writing a question for which there are no records.
 
I don't know how I could forget the null issue - see thread767-783824
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top