2 Replies Latest reply: Aug 26, 2010 10:47 AM by vegar_edgeguide RSS

    Where statement

       

      Here is my problem. I want to add an additional bit to the WHERE statement the code works fine up until I add (PROJECT_ID = 'S07050720' OR PROJECT_ID = 'S07050721' ); Can anyone advise me where I am going wrong. Thanks

       

      (LABOUR_NO = 'MACH ADDS') OR

      (LABOUR_NO = 'MACH MODS') OR

      (LABOUR_NO = 'TEST RWORK') OR

      (LABOUR_NO = 'TEST ADDS') OR

      (LABOUR_NO = 'TEST MODS') OR

       

      (PROJECT_ID = 'S07050720' OR PROJECT_ID = 'S07050721' );

       



        • Where statement

          Maybe you mean this:


          ((LABOUR_NO = 'MACH ADDS') OR
          (LABOUR_NO = 'MACH MODS') OR
          (LABOUR_NO = 'TEST RWORK') OR
          (LABOUR_NO = 'TEST ADDS') OR
          (LABOUR_NO = 'TEST MODS'))
          AND

          (PROJECT_ID = 'S07050720' OR PROJECT_ID = 'S07050721' );


          • Where statement

            I don't see any wrongs in your code, but I believe that there is no need in grouping the two statements marked in green with a single parantesis. Try separating the two and see of your code works.

            It that does not work try changing the OR with a match command:

            match(PROJECT_ID, 'S07050720', 'S07050721') > 0