Re: Help With date/time - Mailing list pgsql-general

From Steve Crawford
Subject Re: Help With date/time
Date
Msg-id 200311081423.36751.scrawford@pinpointresearch.com
Whole thread Raw
In response to Help With date/time  (Alex <alex@meerkatsoft.com>)
List pgsql-general
On Saturday 08 November 2003 9:04 am, Alex wrote:
> Hi,
> I want to remove data that is older that a certain number of
> months.. only full months.
>
> example: today is 11-08 and I want do delete all data that is older
> than this month - 3 month i.e. i want to delete all information
> that is older than Aug. 1st.

select date_trunc('month', now()) - '3 months'::interval;
        ?column?
------------------------
 2003-08-01 00:00:00-07

Cheers,
Steve

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Calculating default values on insert?
Next
From: Rajesh Kumar Mallah
Date:
Subject: Re: Problem in restoring data