Re: Help with syntax for timestamp addition

From: Ian Barwick <barwick(at)gmail(dot)com>
To: Patrick Fiche <patrick(dot)fiche(at)aqsacom(dot)com>
Cc: Scott Nixon <snixon(at)lssi(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Help with syntax for timestamp addition
Date: 2004-11-22 15:02:07
Message-ID: 1d581afe041122070291e623@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 22 Nov 2004 15:12:26 +0100, Patrick Fiche
<patrick(dot)fiche(at)aqsacom(dot)com> wrote:
> Have a try at this syntax
>
> SELECT number
> FROM procedures
> WHERE date + CAST( numdays || ' days' AS interval ) <= CURRENT_TIMESTAMP;

Just for the record you could write it like this too:
SELECT number
FROM procedures
WHERE date + (numdays || ' days')::interval <= CURRENT_TIMESTAMP;

Ian Barwick

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2004-11-22 15:26:55 Re: Help with syntax for timestamp addition
Previous Message Gary L. Burnore 2004-11-22 14:31:01 Re: RFD: comp.databases.postgresql.*