title: Crystal Reports Error Boolean Required errorKind
body: <p>I have been working on some Crystal Reports for one of our clinics but for some reason not I nor our other IT team members understand why this error is happening. So first here is the error specifically given:</p>
  
  <blockquote>
    <p>A boolean is required here. Details: errorKind Error in File
    CPTCharges {FD775771-FD54-40B1-891A-87AFD9539789}.rpt: Error in
    formula CPTCodes: 'if {CPTCodes.Day} = "0" Then ' A boolean is
    required here. Details: errorKind</p>
  </blockquote>
  
  <p>The report has a few formula fields. The one that it is specifically referring to is:</p>
  
  <pre><code>if {CPTCodes.Day} = "0" Then
      if {CPTCodes.D0} = "1" Then
          {CPTCodes.CPTID} 
      else ""
  else if {CPTCodes.Day} = "3" Then
      if {CPTCodes.D3} = "1" Then
          {CPTCodes.CPTID} 
      else ""
  else if {CPTCodes.Day} = "4" Then
      if {CPTCodes.D4} = "1" Then
          {CPTCodes.CPTID} 
      else ""
  else if {CPTCodes.Day} = "5" Then
      if {CPTCodes.D5} = "1" Then
          {CPTCodes.CPTID} 
      else ""
  else if {CPTCodes.Day} = "6" Then
      if {CPTCodes.D6} = "1" Then
          {CPTCodes.CPTID} 
      else ""
  else if {CPTCodes.Day} = "FET" Then
      if {CPTCodes.FET} = "1" Then
          {CPTCodes.CPTID} 
      else "";
  </code></pre>
  
  <p>{CPTCodes.Day} returns either 0,3,4,5,6,FET. Each corresponding {CPTCodes.?} will either be a 1 or a 0. {CPTCodes.CPTID} is a code given from the database corresponding to a procedure that we are charging for.</p>
  
  <p>All this information is being sent in correctly from the previous page. Originally I tried doing a simple switch, but since that wasnt working I tried nested if statements. That doesn't seem to be working. Things Ive tried that ive seen answers for online that hasn't worked:</p>
  
  <ul>
  <li>1) Checked the return type of the dataset incase there was a
  discrepancy</li>
  <li>2) Used both switch and regular nested if statements</li>
  <li>3) Erased and rewritten formula</li>
  <li>4) Try using true/false instead of "0","1",etc. (which wouldn't work for my needs anyway)</li>
  <li>5) Made sure the formulas is under the "Formula Fields" folder in the
  formula editor</li>
  </ul>
  
  <p>The only other thing that we found is that maybe our solution isnt compiling in the correct bit format (well not really a solution...its being run directly on server as opposed to as a solution that I can push updates from....not my choice!). So when I went to check the configuration, all I see is "anyCPU". I dont see an option for x86 or x64.</p>
  
  <p>I am absolutely lost as to why these aren't working!! My last resort is to create a word doc using HTML which I really dont want to do. If I am missing any information that might help in figuring out whats up, please let me know. Any help is GREATLY appreciated!! Thank you!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>New code, tried using this piece of code to see if anything would happen, or if I would get the same error. I got the same error. Below is the code:</p>
  
  <pre><code>if {CPTCodes.Day} = "0" AND {CPTCodes.D0} = "1" Then {CPTCodes.CPTID} Else ""
  </code></pre>
  
  <p>Also to just test the "boolean required here" BS, I put in this code snippet and get an error when saving that "a string is required here":</p>
  
  <pre><code>if {CPTCodes.Day} = true then "true" else "false";
  </code></pre>