Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Easy way to select last 30 days based on DATE column?
On 2005-07-22, Rhugga <chuck.carson_at_gmail.com> wrote:
>
> I want to grab all rows from a table that have a DATE value within the
> last 30 days. (thus it can span 2 months at any given time)
>
> Is this possible with a simple select or do I need to build more logic
> in the application?
It is indeed possible with a simple select and luckily, you need not build more logig in your application.
select ...
from ...
where your_date_column > sysdate - 30;
However, I don't understand why you equate 30 days with 2 months...
hth
Rene
-- Rene Nyffenegger http://www.adp-gmbh.ch/Received on Fri Jul 22 2005 - 18:39:17 CDT