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 012EC32A5C9 for ; Wed, 20 Oct 2004 00:05:12 +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 57482-08 for ; Tue, 19 Oct 2004 23:05:06 +0000 (GMT) Received: from happy.onesystem.ca (happy.onesystem.ca [205.206.61.17]) by svr1.postgresql.org (Postfix) with ESMTP id DEB9932A448 for ; Wed, 20 Oct 2004 00:05:08 +0100 (BST) Received: from elb_lx.onesystem.ca ([10.1.1.50]) by happy.onesystem.ca with asmtp (Exim 4.14) id 1CK32T-0006Gr-34 for pgsql-sql@postgresql.org; Tue, 19 Oct 2004 17:05:09 -0600 Message-ID: <41759DA4.6070803@onesystem.com> Date: Tue, 19 Oct 2004 17:05:08 -0600 From: Edmund Bacon User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: help with to_date and to_char References: <416C74CC.6030309@dri.edu> <9E1E7300-2215-11D9-A5E5-000D93AE0944@sitening.com> <41759C78.1040101@onesystem.com> In-Reply-To: <41759C78.1040101@onesystem.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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/134 X-Sequence-Number: 19237 Edmund Bacon wrote: > When current_date is, say Aug 31 then > > select to_char( to_date('05' || '/' || to_char(current_date, 'DD/YYYY'), > 'MM/DD/YYYY' ), 'MON' ); > NUTS! that should have been select ... to_date('02' || ... { cut, paste, ?edit? } > returns 'MAR', which is probably not what you want. > > This works with 7.3.2, 7.4.5 and 8.0beta2. > -- Edmund Bacon