2 Replies Latest reply on Sep 15, 2014 6:33 AM by philmodjunk

    Or Problem

    firebase

      Title

      Or Problem

      Post

      I am not good in logical operator, so i guees this is a problem of my fundamental understanding.

      Wenn i do:

      1=1

      or

      1=2

      It results into true, because one of either is true.

      But when i do a more complicated SQL forumlar it does not work the same way.

      Like

      table1::field  ≠  ExecuteSQL ("SELECT field1 FROM table2 WHERE field2 = ? " ;"";""; table3::field )

      or

      table4::field  ≠  ExecuteSQL ("SELECT field1 FROM table5 WHERE field2 = ? " ;"";""; table5::field )

      What i used is more complicated but anyway, both sides work for itself but as soon i use both and place the or in between it does not work anymore. I also tried Not before the first liune and eafter the or instead of ≠ and using =.

       

       

        • 1. Re: Or Problem
          firebase

          I found it by myself

          It should be

          NOT(

          1 ≠ 1

          or

          1  ≠ 2

          )

          Dont know why buth the double  ≠ operator is causing the problem.

          Even

          (1 ≠1)

          or

          (1 ≠2)

          Did not solved it.

          • 2. Re: Or Problem
            philmodjunk

            What you post in your last comment does not match the SQL examples in your first post. There are a number of reason why comparing the value of a field to the results of ExecuteSQL might fail--in particular, the query might be returning values from multiple records.

            But I think your last expression can be changed to:

            Field 1 ≠ 1 AND Field 1 ≠ 2

            Field 1 ≠ 1 or Field 1 ≠ 2

            will always be true as any value that you select for Field 1 will always cause the expression on one side or the other of the OR operator to be True.