Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E8D8A9FB8BC for ; Tue, 16 Oct 2007 15:05:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 53996-04-4 for ; Tue, 16 Oct 2007 15:05:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 21B659FB98D for ; Tue, 16 Oct 2007 15:05:21 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=crankycanuck.ca) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1Ihqms-0006W1-Kv for pgsql-sql@postgresql.org; Tue, 16 Oct 2007 14:05:02 -0400 Received: by crankycanuck.ca (Postfix, from userid 1000) id 438BA4050; Tue, 16 Oct 2007 14:04:55 -0400 (EDT) Date: Tue, 16 Oct 2007 14:04:55 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: what's wrong with my date comparison? Message-ID: <20071016180455.GQ3255@crankycanuck.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/76 X-Sequence-Number: 29448 On Tue, Oct 16, 2007 at 10:57:03AM -0700, Tena Sakai wrote: > select name, value, datecreated > from mytable > where datecreated > 2007-10-02; ^^^^^^^^^^ 2007-10-02 is an arithmetic expression equivalent to 1995. I think what you want is WHERE datecreated > '2007-10-02'; Note the quotes. A -- Andrew Sullivan | ajs@crankycanuck.ca In the future this spectacle of the middle classes shocking the avant- garde will probably become the textbook definition of Postmodernism. --Brad Holland