I'm trying to run a select statement in a reporting tool. And one of the select criteria is that it must return all data which was modified last month. So one of the coloumns has this date in the format YYYY/MM.
At the minute this has to be entered manually, as there is a user interface that can be used infront of the SQL.
I was wondering if there was a way to make this run automatically without user entry. i.e. replace:
SELECT * FROM table1 WHERE date BETWEEN '2005/06' AND '2005/07'
to something more like
SELECT * FROM table1 WHERE date >= ((sysdate, YYYY MM)MM, -1) AND date < (sysdate, YYYY MM)
I know the above is a bad attempt but just trying to show the problem.