Re: Adding an INTERVAL to a variable - Mailing list pgsql-sql

From Vivek Khera
Subject Re: Adding an INTERVAL to a variable
Date
Msg-id x73d737w54.fsf@onceler.kciLink.com
Whole thread Raw
Responses Re: Re: Adding an INTERVAL to a variable
List pgsql-sql
>>>>> "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/


pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Are circular REFERENCES possible ?
Next
From: mbenzid@yahoo.de (Mounir Benzid)
Date:
Subject: Why can't I .........