Received: from zwolle.execulink.net (zwolle.execulink.net [199.166.6.25]) by hub.org (8.10.1/8.10.1) with ESMTP id e6C0c5W95327 for ; Tue, 11 Jul 2000 20:38:05 -0400 (EDT) Received: from bax7 (ppp31.d1-2.56k.execulink.com [209.239.20.95]) by zwolle.execulink.net (8.10.0/8.10.0) with SMTP id e6C0c0I26533 for ; Tue, 11 Jul 2000 20:38:00 -0400 Message-Id: <3.0.6.32.20000711203943.01184100@execulink.com> X-Sender: fbax@execulink.com X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Tue, 11 Jul 2000 20:39:43 -0400 To: pgsql-sql@postgresql.org From: Frank Bax Subject: Re: Creating timestamps in queries? In-Reply-To: References: <001c01bfeaf8$96812be0$39117118@rct1.bc.wave.home.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Archive-Number: 200007/123 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? > > >