0
I need to create a query that looks for a call according to the time interval.
Example: An employee opens a call in the system, but it will only be shown if it stays open for 2 to 4 hours.
I’m using this code, but I got no result.
SELECT date FROM db WHERE date >= DATE_SUB(NOW(), INTERVAL -2 HOUR) AND DATE_SUB(NOW(),INTERVAL 4 HOUR) AND status='1';
I was able to find out: SELECT date FROM db WHERE date <= DATE_SUB(NOW(), INTERVAL 2 HOUR) AND DATE_SUB(NOW(),INTERVAL 4 HOUR) AND status='1';
– ALAN BERTOLDO OLIVEIRA
Did you find out, or are you still having the problem? .
– RXSD