Search code examples
crystal-reportscomparison-operators

What are the comparison operators in case statement formula?


Working with Crystal Reports 2016. My select case statement has 3 possible values, 0 through 2. I want to assign text labels for them in a chart. Crystal Reports says I can't use = as a comparison operator, which is weird because this page says it is a comparison operator (as opposed to an assignment operator). What operator should I use?

This code check out according to the formula Workshop:

select ({CRV_AttributeLog.AnalogValue})
  case is < 1: "Offline"
  case is <= 1: "Partially Online"
  case is > 1: "Online"
  default: "Unknown";

This is what i want to do:

select ({CRV_AttributeLog.AnalogValue})
  case is = 0: "Offline"
  case is = 1: "Partially Online"
  case is = 2: "Online"
  default: "Unknown";

== also does not work


Solution

  • You do not need the 'is =' portion in the select statement .. see below

    select ({CRV_AttributeLog.AnalogValue})
      case 0: "Offline"
      case 1: "Partially Online"
      case 2: "Online"
      default: "Unknown";