DATE field subtraction
Hi,
I assume I am just to blind to find it in the documentation: I have a DATE
field and want to subtract 4 weeks.
SELECT [...]
FROM table
WHERE datefield >= '2002-08-19' - interval '4 weeks'
Kind regards
... Ralph ...
Ralph Graulich wrote:
SELECT [...]
FROM table
WHERE datefield >= '2002-08-19' - interval '4 weeks'
There are probably shorter forms, but the full version would be:
'2002-08-19'::date - '4 weeks'::interval
--
Peter Gibbs
EmKel Systems
On Mon, Aug 19, 2002 at 12:33:34PM +0200, Ralph Graulich wrote:
Hi,
I assume I am just to blind to find it in the documentation: I have a DATE
field and want to subtract 4 weeks.SELECT [...]
FROM table
WHERE datefield >= '2002-08-19' - interval '4 weeks'
I'd do:
SELECT [...]
FROM table
WHERE datefield >= '2002-08-19'::date - 28;
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
Show quoted text
There are 10 kinds of people in the world, those that can do binary
arithmetic and those that can't.