Re: subtracting minutes from date

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Brandon Metcalf <bmetcalf(at)nortel(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: subtracting minutes from date
Date: 2006-02-24 06:03:35
Message-ID: 20060224060335.GA2481@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 23, 2006 at 13:55:34 -0600,
Brandon Metcalf <bmetcalf(at)nortel(dot)com> wrote:
>
> If I have a column called date with data type timestamp without time
> zone I know I can use
>
> SELECT * FROM table WHERE date < (now()::DATE - 7)::TIMESTAMP;

You can do this without converting to timestamp:
SELECT * FROM table WHERE date < current_date - 7;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-02-24 07:43:20 Re: ECPG and COPY
Previous Message Wes 2006-02-24 04:26:35 ECPG and COPY