From: Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
To: Andrew Perrin - Demography <aperrin@demog.berkeley.edu>
To: pgsql-sql@postgresql.org
Subject: Re: Subtracting from a date
Date: Thu, 13 Apr 2000 10:28:26 +0100
Message-ID: <007f01bfa52a$9f591c50$760e01a3@oucs.ox.ac.uk> (raw)
References: <Pine.LNX.4.10.10004121040080.12210-100000@famine.DEMOG.Berkeley.EDU>
WHERE age('now',date_effective::datetime)<='3 years'::timespan
I don't know if 'now' in that context is still the authoritative way to
write now, maybe it should be
WHERE age(now(),date_effective::datetime)<='3 years'::timespan
if date_effective is actually a datetime field, which I understand we are
moving to in 7.0 (date fields being non-SQL-standard), then you don't need
the cast, obviously.
----------------------------------------------------------------
Moray.McConnachie@computing-services.oxford.ac.uk
----- Original Message -----
From: "Andrew Perrin - Demography" <aperrin@demog.berkeley.edu>
To: <pgsql-sql@postgresql.org>
Sent: Wednesday, April 12, 2000 6:46 PM
Subject: [SQL] Subtracting from a date
> I need to find all records with a date field (date_effective) 3 years or
> less prior to now(). This clearly must be possible, but I'm not figuring
> it out. Any suggestions?
>
> ---------------------------------------------------------------------
> Andrew J. Perrin - aperrin@demog.berkeley.edu - NT/Unix Admin/Support
> Department of Demography - University of California at Berkeley
> 2232 Piedmont Avenue #2120 - Berkeley, California, 94720-2120 USA
> http://demog.berkeley.edu/~aperrin --------------------------SEIU1199
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: moray.mcconnachie@computing-services.oxford.ac.uk, aperrin@demog.berkeley.edu
Subject: Re: Subtracting from a date
In-Reply-To: <007f01bfa52a$9f591c50$760e01a3@oucs.ox.ac.uk>
References: <Pine.LNX.4.10.10004121040080.12210-100000@famine.DEMOG.Berkeley.EDU> <007f01bfa52a$9f591c50$760e01a3@oucs.ox.ac.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox