Hi All,I'm hoping for some help in my WHERE statement below. I'm trying to pull data from where the date must be from yesterday but it also must complete a few or statements. But whenever I add in the OR statements SQL then completely ignores my date condition. I've tried so many different combinations including adjusting my order of operations with many brackets but i'm not getting anywhere.I'm pretty sure its some type of order of the ANDs\ORs but I just can't figure it out.here's my statement that fails:WHERE b.field1 LIKE 'ABC' AND b.field2 BETWEEN GETDATE() - 30 AND GETDATE() OR c.field3 != 'A' OR a.field4 = '0' OR a.field5 NOT IN ('1', '2', '7', 'B') OR d.field6 < 2 OR d.field7 NOT IN ('CO','LT','B7')Please help i'm just about ready to bang my head against the wall!!
↧