Re: subtracting minutes from date - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: subtracting minutes from date
Date
Msg-id 20060223232512.GJ2068@pervasive.com
Whole thread Raw
In response to Re: subtracting minutes from date  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-general
On Thu, Feb 23, 2006 at 03:08:32PM -0600, Scott Marlowe wrote:
> >   SELECT * FROM table WHERE date < now()::DATE::(TIMESTAMP - 60);
>
> Tell it you're subracting a minute:
>
> select now() - interval '13 minutes';

Or, better yet if you're feeding in a variable:

date < now() - ( 13 * '1 minute'::interval )
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Error correction to FAQ
Next
From: "Jim C. Nasby"
Date:
Subject: Re: now() time off