title: SSRS: IIF Statement evaluating incorrectly
body: <p>I'm working in Visual Studio.</p>
  
  <p>In an SSRS Report I have an IIF Statement that is malfunctioning as follows:</p>
  
  <p>There is a field [FieldName] that has a value of 'IHFA' in one of the rows.</p>
  
  <p>I put a field named TestField in the report with this IIF expression in it.</p>
  
  <p><code>=iif((Fields!FieldName.Value = "IHFA"), "Y", "N")</code></p>
  
  <p>When I run the report, there is an 'N' in TestField in the row that has IHFA in FieldName. There should be a 'Y'.</p>
  
  <p>Another value in the FieldName field [in another row] is 'ServiSolutions'.</p>
  
  <p>If I change the expression in my TestField to:</p>
  
  <pre><code>=iif((Fields!FieldName.Value = "ServiSolutions"), "Y", "N")
  </code></pre>
  
  <p>I get a 'Y' in the row that has ServiSolutions in it. So in this case it is working correctly.</p>
  
  <p>I've tried:</p>
  
  <p>LTrim RTrim on the FieldName field in my SQL.</p>
  
  <p>I have returned ASCII values for each of the characters in the field that has the 'IHFA' value [to see if there are hidden characters?] and I get 73  72  70  65 . . . which is correct.</p>
  
  <p>In SSMS, I have tried a Where clause:
      Where FieldName = 'IHFA'
  in the SQL and that returns only rows that have 'IHFA' in FieldName.</p>
  
  <p>I'd appreciate any help I can get! :)</p>