Received: from mail.rdc2.bc.home.com (ha1.rdc2.bc.wave.home.com [24.2.10.68]) by hub.org (8.10.1/8.10.1) with ESMTP id e6C1RkW10821 for ; Tue, 11 Jul 2000 21:27:47 -0400 (EDT) Received: from cr699264a ([24.113.17.57]) by mail1.rdc2.bc.home.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20000712010514.IKGP10910.mail1.rdc2.bc.home.com@cr699264a> for ; Tue, 11 Jul 2000 18:05:14 -0700 From: "Rob S." To: Subject: RE: Creating timestamps in queries? Date: Tue, 11 Jul 2000 18:07:24 -0700 Message-ID: <001701bfeb9d$89c44f40$39117118@rct1.bc.wave.home.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <3.0.6.32.20000711203943.01184100@execulink.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Importance: Normal X-Archive-Number: 200007/124 My friends, you are truly life-savers. Thanks very much! How on Earth do you know this stuff? =) I saw all of these in the User's Guide (re: now(), interval keyword, etc.), but in no way would figure this was how they were put together! Aside from the few in the FAQ, is there a list of commonly-done queries? There are some for SELECT and whatnot, but maybe asking for that for these far-out ones is too much. Thanks again all ;) - A very grateful Rob Slifka > -----Original Message----- > From: pgsql-sql-owner@hub.org [mailto:pgsql-sql-owner@hub.org]On Behalf > Of Frank Bax > Sent: July 11, 2000 5:40 PM > To: pgsql-sql@postgresql.org > Subject: Re: [SQL] Creating timestamps in queries? > > > I think you meant: > > select * from blah where stamp >= now() - '7days'::interval; > > You can also try: > > select * from blah where age( now(), stamp ) < '7days'::interval; > > Frank > > At 09:07 AM 7/11/00 +0200, you wrote: > >Hi Rob, > > > >Try this: > > > >select * from blah where stamp >= now()::date - 7; > > > >I think it should work. > > > >/Patrik Kudo > > > >On Mon, 10 Jul 2000, Rob S. wrote: > > > >> Hi all, > >> > >> I would like to say, > >> > >> "select * from blah where stamp >= 7 days ago" > >> > >> ...where the "days ago" is calculated at query time; meaning > that its not > >> hardcoded into the query as a date string. Is this possible? > > > > > > >