X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 75C3F329F7F for ; Sun, 10 Oct 2004 15:50:20 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49431-06 for ; Sun, 10 Oct 2004 14:50:12 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 762AD329F03 for ; Sun, 10 Oct 2004 15:50:15 +0100 (BST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i9AEoB2B051571 for ; Sun, 10 Oct 2004 14:50:11 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i9AEbTP7048707 for pgsql-sql@postgresql.org; Sun, 10 Oct 2004 14:37:29 GMT From: Gaetano Mendola X-Newsgroups: comp.databases.postgresql.sql Subject: Re: SQL doubt - Date Add Date: Sun, 10 Oct 2004 16:37:36 +0200 Organization: PYRENET Midi-pyrenees Provider Lines: 21 Message-ID: References: <5d14ecf904101007197d0acbbf@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@pyrenet.fr User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en In-Reply-To: <5d14ecf904101007197d0acbbf@mail.gmail.com> To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/69 X-Sequence-Number: 19172 sreejith s wrote: > Hi friends, > I problem is i want to add a specified no. of years to a > given date > ie, 12/12/2004 + 5 = 12/12/2009. This has to be done via sql. Any > predefined function there for the same. or v have split the yr and > then add. > Sreejith > # select '2004-12-12'::date + 5 * '1 year'::interval; ?column? --------------------- 2009-12-12 00:00:00 (1 row) Regards Gaetano Mendola