X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7118F4759BD for ; Mon, 10 Feb 2003 13:14:16 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id E830A47595A for ; Mon, 10 Feb 2003 13:14:15 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 4E891D609; Mon, 10 Feb 2003 10:14:15 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 443A05C02; Mon, 10 Feb 2003 10:14:15 -0800 (PST) Date: Mon, 10 Feb 2003 10:14:15 -0800 (PST) From: Stephan Szabo To: Cc: Subject: Re: problems with date and interval queries. In-Reply-To: <36167.24.136.118.31.1044900318.squirrel@zero.voxel.net> Message-ID: <20030210101150.P99596-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/196 X-Sequence-Number: 11594 On Mon, 10 Feb 2003 john@flowlabs.com wrote: > I am having problems adding an interval to a date in a select statement > where the interval is specified as a selected column. Is this possible? > Below is an example of the query that I'm executing. The query gives and > error at the num_min column in the outer query. It works fine if that is > replaced with the text '90 minutes'. Thank you in advance for all help > provided. interval is the form for an interval literal. If the column is already an interval, you probably don't need it at all. If you need to cast it you should do a cast CAST (num_min AS INTERVAL)