Re: Help With date/time

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Alex <alex(at)meerkatsoft(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Help With date/time
Date: 2003-11-08 22:23:36
Message-ID: 200311081423.36751.scrawford@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-11-08 23:03:40 Re: Problem in restoring data
Previous Message Bruno Wolff III 2003-11-08 22:00:53 Re: Calculating default values on insert?