Re: using dates in pgsql - Mailing list pgsql-novice

From Tyler Colbert
Subject Re: using dates in pgsql
Date
Msg-id bj3gvp$2mk$1@sea.gmane.org
Whole thread Raw
In response to using dates in pgsql  (JohnH <JohnH@atkgib.com.au>)
List pgsql-novice
"Ron Johnson" <ron.l.johnson@cox.net> wrote in message
news:1062080015.25751.319.camel@haggis...
> On Thu, 2003-08-28 at 08:41, Tom Lane wrote:
> > <shrug> ... that's what the "date - integer" operator is defined to do.
> > If you want some other behavior, create another operator.
>

I have used something like this:
    now() - interval '3 hours'

so I supposed you could do
    CURRENT_DATE - interval '188 days'

this would probably work more accurately (due to leap year)
    CURRENT_DATE - interval '6 months'

or if you want to take time into account
    now() - interval '6 months'

Tyler Colbert




pgsql-novice by date:

Previous
From: Christopher Browne
Date:
Subject: Re: Number of rows in a table
Next
From: Oliver Fromme
Date:
Subject: Revoke access on pg_user