We are trying to query incident records created in last n minutes, n hours, n days, n months etc.
This expression is not working and returning error.
SELECT * from Incident where CreatedTime < sysdate() - 1
We are using the above query to find those records created in last 1 day.
We also tried the date_diff function but it appears we can't use it in the 'Where' clause.
SELECT * FROM Incident where date_diff(CreatedTime, sysdate()) < 1800
We use the above query to find out records created in last 30 minutes. But this throws an error - 'the WHERE clause has complex expressions involving columns in calculations or function calls'
We need help on how to use the date_diff() or sysdate() functions.