Re: Adding an INTERVAL to a variable

From: Vivek Khera <khera(at)kcilink(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Adding an INTERVAL to a variable
Date: 2001-08-07 15:00:23
Message-ID: x73d737w54.fsf@onceler.kciLink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>>>>> "GC" == Graham Coates <graham(at)mindvision(dot)com(dot)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(at)kciLink(dot)com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2001-08-07 15:01:45 Re: Are circular REFERENCES possible ?
Previous Message Jan Wieck 2001-08-07 14:43:59 Re: Simple Insert Problem