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 A6B803A4B9A for ; Fri, 19 Nov 2004 16:05:10 +0000 (GMT) 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 57083-02 for ; Fri, 19 Nov 2004 16:05:09 +0000 (GMT) Received: from sigurd.incentre.net (unknown [206.75.213.195]) by svr1.postgresql.org (Postfix) with ESMTP id F1D2D3A4B97 for ; Fri, 19 Nov 2004 16:05:07 +0000 (GMT) Received: from incentre.net (sigurd.incentre.net [127.0.0.1]) by sigurd.incentre.net (8.12.10/8.12.10) with ESMTP id iAJG53I3011909 for ; Fri, 19 Nov 2004 09:05:03 -0700 Message-ID: <419E19AF.9030405@incentre.net> Date: Fri, 19 Nov 2004 09:05:03 -0700 From: Guy Fraser Organization: The Internet Centre User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040124 X-Accept-Language: en-ca, en-gb, en-us, en MIME-Version: 1.0 To: PgSQL - SQL Subject: Re: Comparing Dates References: <419D0DC6.5080504@candoltd.com> <87y8gy2xr1.fsf@stark.xeocode.com> <5A709098-39F1-11D9-95C2-000D93AE0944@sitening.com> In-Reply-To: <5A709098-39F1-11D9-95C2-000D93AE0944@sitening.com> Content-Type: text/plain; charset=ISO-8859-1; 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: 200411/197 X-Sequence-Number: 19516 You should use single quotes for all literals. Examples: select '2004-06-08' ; ?column? ------------ 2004-06-08 select 'user' ; ?column? ---------- user Failing to quote literals will cause unexpected results. Examples: select 2004-06-08 ; ?column? ---------- 1990 select user ; current_user -------------- guy "Thomas F.O'Connell" writes: > select 2004-06-08; > ?column? > ---------- > 1990 > > I'm not exactly sure how the bare string is converted internally, but > it's > clearly not a complete date like you're expecting. -- Guy Fraser Network Administrator The Internet Centre 780-450-6787 , 1-888-450-6787 There is a fine line between genius and lunacy, fear not, walk the line with pride. Not all things will end up as you wanted, but you will certainly discover things the meek and timid will miss out on.