title: Parameter in IF condition for record selection in Crystal Report
body: <p>I am creating a Crystal Report. In my report there are three parameters. Now I would like to filter data according to the parameter value. Therefore in record selection formula I have written the following formula.</p>
  
  <pre><code>(
      {Table_Name.Field01} = {?Field01}
  )
  and
  (
      if HasValue({?Field02}) Then 
          { Table_Name. Field02} Like ('*'+{?Field02}+'*') 
      else true
  )
  and
  (
      if HasValue({?Field03}) Then 
          { Table_Name. Field03} = ToNumber({?Field03}) 
      else True
  );
  </code></pre>
  
  <p>The problem is not working. It’s only working if I add the third parameter in my IF condition. </p>
  
  <pre><code>and
  (
      if HasValue({?Field03}) Then 
          { Table_Name. Field03} = ToNumber({?Field03}) 
      else True
  );
  </code></pre>
  
  <p>Can anyone give me idea how to fix the problem. I am using Crystal Report 2008.</p>