1

Trying to pull specific order dates within a date range where order IDs have a specific name in them. However, my below query seems to ignore the order date clause and pulls in orders outside of the date range.

SELECT * FROM Orders 
WHERE OrderID LIKE '%Dev%' OR OrderID LIKE '%STG%' OR OrderID LIKE '0000%' 
AND companynumber = 600
AND OrderDate >= DATE_SUB(CURDATE(),INTERVAL 90 DAY); 

Using only one like operator makes it work..so the issue is stemming from the LIKE operators I just don't know where.

merkagent
  • 11
  • 2

0 Answers0