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 A918D32A010 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 50387-04 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 85151329F77 for ; Sun, 10 Oct 2004 15:50:16 +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 i9AEoB2D051571 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 i9AEamXD048613 for pgsql-sql@postgresql.org; Sun, 10 Oct 2004 14:36:48 GMT From: Gaetano Mendola X-Newsgroups: comp.databases.postgresql.sql Subject: Re: SQL doubt - Date Add Date: Sun, 10 Oct 2004 16:36:54 +0200 Organization: PYRENET Midi-pyrenees Provider Lines: 22 Message-ID: <41694906.3030408@bigfoot.com> 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 To: sreejith s 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/70 X-Sequence-Number: 19173 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