Search code examples
crystal-reports

Formula to check if string is empty in Crystal Reports


I have written a formula to return a string based on logic run on a string field in my database. I have everything working, except I'm unable to return when the field is the empty string.

This is what I need:

...
else if ({TABLE.FIELD} = "") then
    "Fixed"
...

However, this entry appears as the empty string in my report. I've tried testing the length of the field to 0 and the StrCmp functions. Nothing seems to work. Google results state that a simple comparison to "" or '' should make the logic work. I am new to CR, so maybe I am missing something. Any ideas on how I can acquire this functionality?


Solution

  • You can check for IsNull condition.

    If IsNull({TABLE.FIELD}) or {TABLE.FIELD} = "" then
      // do something