Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f77F2O670504 for ; Tue, 7 Aug 2001 11:02:24 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f77F0PA07372 for pgsql-sql@postgresql.org; Tue, 7 Aug 2001 11:00:25 -0400 (EDT) (envelope-from news) From: Vivek Khera X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Adding an INTERVAL to a variable Date: 07 Aug 2001 11:00:23 -0400 Organization: Khera Communications, Inc., Rockville, MD Lines: 20 Message-ID: References: <9kg88k$1j30$1@news.tht.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: scrappy@hub.org User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) To: pgsql-sql@postgresql.org X-Archive-Number: 200108/97 X-Sequence-Number: 4318 >>>>> "GC" == Graham Coates 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/