Add two ranges in a search

0

I need to create a query that looks up a call according to the time interval.

Example: An employee opens a call on the system, but it will only be shown if it is open for 2 to 4 hours.

I'm using this code, but I did not get results.

SELECT date FROM db WHERE date >= DATE_SUB(NOW(), INTERVAL -2 HOUR) AND DATE_SUB(NOW(),INTERVAL 4 HOUR) AND status='1';
    
asked by anonymous 13.10.2018 / 22:59

0 answers