Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Easy way to select last 30 days based on DATE column?

Re: Easy way to select last 30 days based on DATE column?

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: Fri, 22 Jul 2005 23:39:17 +0000 (UTC)
Message-ID: <dbs035$kc7$1@klatschtante.init7.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US