35 pts.
 Crystal Reports XI – SQL table fields that fail all compare tests
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)
ASKED: August 26, 2010  3:15 PM
UPDATED: August 26, 2010  4:41 PM

Answer Wiki:
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.
Last Wiki Answer Submitted:  August 26, 2010  4:41 pm  by  BTod   35 pts.
All Answer Wiki Contributors:  BTod   35 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _