From: Graham Coates <graham@mindvision.com.au>
To: pgsql-sql@postgresql.org
Subject: Re: Adding an INTERVAL to a variable
Date: Thu, 9 Aug 2001 16:47:01 +0930
Message-ID: <9ktddf$134e$1@news.tht.net> (raw)
References: <9kg88k$1j30$1@news.tht.net>
<x73d737w54.fsf@onceler.kciLink.com>
Thanks for the inspiration Vivek!
Didn't quite work, but when I made it...
dSalesHdrDateDue + (iAcctPayDaysAv || 'Days')::INTERVAL
BINGO! it works.
Happiness is :-)
Graham Coates
"Vivek Khera" <khera@kcilink.com> wrote in message
news:x73d737w54.fsf@onceler.kciLink.com...
> >>>>> "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: graham@mindvision.com.au
Subject: Re: Adding an INTERVAL to a variable
In-Reply-To: <9ktddf$134e$1@news.tht.net>
* 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