3 Replies Latest reply: Oct 17, 2016 11:47 AM by Crystle Stamper RSS

    Where Clause using OR and AND not working

    Crystle Stamper

      I have a where clause that I need to filter the data set for specific users AND also only show two possible statuses for those specific users.

       

      Here is my Where clause with just the users filtered for.

       

      Where User = 'John'

         or User = 'Sally'

         or User = 'Beth'

       

      But what I need is to add a filter for the Status field but also keep the specified users... Here is what I have been trying but it won't actually filter the Status Field, it keeps showing all the statuses for the users specified.

       

      Test 1

      Where User = 'John'

         or User = 'Sally'

         or User = 'Beth'

         and Match(Status,'Past Due', 'In Process')

       

      Test 2

      Where User = 'John'

         or User = 'Sally'

         or User = 'Beth'

         and Status='Past Due' or Status= 'In Process'

       

      Test 3

      Where Status='Past Due' or Status= 'In Process'

         and User = 'John'

         or User = 'Sally'

         or User = 'Beth'

       

       

      NONE of these work. I am sure something is wrong with my syntax. Any help or advice would be greatly appreciated.

      Thanks!