From: Michael Fuhr <mike@fuhr.org>
To: Fatih Cerit <fatih@intersan.com.tr>
Cc: pgsql-sql@postgresql.org
Subject: Re: interval +variable
Date: Wed, 9 Mar 2005 02:17:36 -0700
Message-ID: <20050309091736.GA29736@winnie.fuhr.org> (raw)
In-Reply-To: <008a01c52486$1c1c9520$bb41ccd5@cerit>
References: <008a01c52486$1c1c9520$bb41ccd5@cerit>
On Wed, Mar 09, 2005 at 10:58:05AM +0200, Fatih Cerit wrote:
> 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' :(
Are you looking for something like this?
ndays := 30;
SELECT INTO futuredate now() + ndays * interval'1 day';
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mike@fuhr.org, fatih@intersan.com.tr
Subject: Re: interval +variable
In-Reply-To: <20050309091736.GA29736@winnie.fuhr.org>
* 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