Crystal Reports XI – SQL table fields that fail all compare tests

45 pts.
Tags:
Crystal Reports XI
Crystal XI
SQL
SQL Server
SQL tables
Windows Server
I have an SQL table with a field that Crystal XI displays as string 300, call it mytable.mystring.
If I create a formula field (myformula) such as...
if {mytable.mystring} = "test value" then 1
else 2
This is what happens during execution... 
when the the preceding test is true, Crystal returns a value of 1 in myformula; exactly what I expect.
But if the value in mytable.mystring is not "test value", Crystal returns nothing; neither 1 nor 2. When I place myformula on the report, under these circumstances, I get nothing displayed (blanks) except the number 1 when the test is true.
This may actually be an SQL question but the symptoms are occurring in Crystal. Why isn't myformula = 2 when the preceding test fails? What kind of SQL field (that Crystal displays as string) can cause Crystal to completely ignore all tests and return nothing. I have also tested this field with the null comparator in Crystal...
if {mytable.mystring} = "" then 1 else 2
 
In this case I again get nothing returned in the formula field no matter what resides in mystring.
Can anyone help with this problem? Thank you.


Software/Hardware used:
Crystal XI, Windows Server (unknown version), SQL (unknown version)

Answer Wiki

Thanks. We'll let you know when a new response is added.

Let me add that I also tried a formula compare test as follows…

1;
if {mytable.mystring} = “test value” then 2;

This also returns blank/nothing in every case. Even if a constant is first placed in the formula, the formula field becomes blank as soon as the comparison is not true.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following