Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f44EQcA10383 for ; Fri, 4 May 2001 10:26:38 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f44EK4a49731 for pgsql-sql@postgresql.org; Fri, 4 May 2001 10:20:04 -0400 (EDT) (envelope-from news) From: Vivek Khera X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Dateadd Date: 04 May 2001 10:20:02 -0400 Organization: Khera Communications, Inc., Rockville, MD Lines: 22 Message-ID: References: <9cqdur$m1u$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: 200105/21 X-Sequence-Number: 2819 >>>>> "LP" == Ligia Pimentel writes: LP> I need to know if there is a sql function implemented in postgres LP> that gives me a date plus any number of days, months or years (the LP> traditional dateadd function) or how to do it in sql? Here's what I use: select CURRENT_DATE + '4 DAYS'::interval; Just cast your "interval" from a string to an interval type, then add it to your date value. I doubt this is portable. What "tradition" provides for a dateadd() function? -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 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/