From: Vivek Khera <khera@kcilink.com>
To: pgsql-sql@postgresql.org
Subject: Re: Adding an INTERVAL to a variable
Date: 07 Aug 2001 11:00:23 -0400
Message-ID: <x73d737w54.fsf@onceler.kciLink.com> (raw)
References: <9kg88k$1j30$1@news.tht.net>
>>>>> "GC" == Graham Coates <graham@mindvision.com.au> writes:
GC> SELECT Invoices.InvoiceDate + INTERVAL '41 Days'
GC> works fine
GC> but when trying to substitute the number of days with a value form a field
GC> e.g.
GC> SELECT Invoices.InvoiceDate + INTERVAL Acct.AverageDaysToPay 'Days'
try
SELECT Invoices.InvoiceDate + Acct.AverageDaysToPay::interval
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
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: khera@kcilink.com
Subject: Re: Adding an INTERVAL to a variable
In-Reply-To: <x73d737w54.fsf@onceler.kciLink.com>
* 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