2 Replies Latest reply: May 15, 2014 10:10 AM by anloisel _ RSS

    If .And. Statement problem

    anloisel _

      I am having problems with the following IF statement and cannot figure out why I am getting an "Oprand Count" error message.


      If(="999" .And. ="Canada",[Ship-To City],)


      Both fields are character fields.



      Thank you for your help,

        • If .And. Statement problem
          Data Kruncher

          Your If statement is incomplete.


          You've got the condition (part 1) and the result if TRUE (part 2), but you're missing the result if FALSE (part 3).


          Using this instead:

          If(="999" .And. ="Canada",[Ship-To City],"")[/CODE]


          will result in returning the Ship-To City when the sold-To value is "999" and the Ship To Country is Canada, but an empty string "" when they're not.


          Change the "" in the expression if you want another value, but you must supply some value, even "".