Re: interval +variable

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Fatih Cerit <fatih(at)intersan(dot)com(dot)tr>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: interval +variable
Date: 2005-03-09 14:19:08
Message-ID: 20050309141908.GA32013@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Mar 09, 2005 at 10:58:05 +0200,
Fatih Cerit <fatih(at)intersan(dot)com(dot)tr> wrote:
> Dear all
>
> Is there anyone at there who knows howto use dateadd in pgsql. I have a
> problem in my function that is like this ;
>
> Select into futuredate now() + interval '30 days'; <- this is ok
> but how can I use a variable intead of '30 days' :(

A better solution may to be to use the date type instead of the timestamp type.
Then you can just add an integer number to the date. You also don't have
to worry about daylight savings time changes.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2005-03-09 14:19:45 Re: Table like a field
Previous Message Gary Stainburn 2005-03-09 14:06:11 Re: order by question