RATE THIS ANSWER
0
Click to Vote:
0
0
You did not mention which database system you're using, and this is an important item of information, as all of them seem to have a different set of date functions.
The
standard SQL way of doing it is with [i]intervals[/i] --
SELECT foo FROM bar WHERE datecolumn = CURRENT_DATE - INTERVAL 1 MONTH
MySQL supports this, as do several others.
In Microsoft SQL Server, you have to use the proprietary GETDATE and DATEADD functions --
SELECT foo FROM bar WHERE datecolumn = DATEADD(MONTH,-1,GETDATE())