| From: | "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com> | 
|---|---|
| To: | Scott Marlowe <smarlowe(at)g2switchworks(dot)com> | 
| Cc: | Brandon Metcalf <bmetcalf(at)nortel(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org> | 
| Subject: | Re: subtracting minutes from date | 
| Date: | 2006-02-23 23:25:12 | 
| Message-ID: | 20060223232512.GJ2068@pervasive.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | 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(at)pervasive(dot)com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jim C. Nasby | 2006-02-23 23:36:18 | Re: now() time off | 
| Previous Message | Jim C. Nasby | 2006-02-23 23:23:55 | Re: [GENERAL] Error correction to FAQ |